Author: kmachalkova
Date: Fri Feb 8 13:59:32 2008
New Revision: 44281
URL: http://svn.opensuse.org/viewcvs/yast?rev=44281&view=rev
Log:
pkg selector stuff ++
Added:
branches/tmp/bubli/ncurses-pkg/MAINTAINER
branches/tmp/bubli/ncurses-pkg/Makefile.cvs
branches/tmp/bubli/ncurses-pkg/POTFILES
branches/tmp/bubli/ncurses-pkg/RPMNAME
branches/tmp/bubli/ncurses-pkg/SUBDIRS
branches/tmp/bubli/ncurses-pkg/VERSION
branches/tmp/bubli/ncurses-pkg/configure.in.in
branches/tmp/bubli/ncurses-pkg/doc/
branches/tmp/bubli/ncurses-pkg/doc/.cvsignore
branches/tmp/bubli/ncurses-pkg/doc/Makefile.am
branches/tmp/bubli/ncurses-pkg/doc/autodocs/
branches/tmp/bubli/ncurses-pkg/doc/autodocs/.cvsignore
branches/tmp/bubli/ncurses-pkg/doc/autodocs/Makefile.am
branches/tmp/bubli/ncurses-pkg/package/
branches/tmp/bubli/ncurses-pkg/package/.cvsignore
branches/tmp/bubli/ncurses-pkg/package/yast2-ncurses.changes
branches/tmp/bubli/ncurses-pkg/src/
branches/tmp/bubli/ncurses-pkg/src/.cvsignore
branches/tmp/bubli/ncurses-pkg/src/Makefile.am
branches/tmp/bubli/ncurses-pkg/src/NCPackageSelector.cc
branches/tmp/bubli/ncurses-pkg/src/NCPackageSelector.h
branches/tmp/bubli/ncurses-pkg/src/NCPackageSelectorPluginImpl.cc
branches/tmp/bubli/ncurses-pkg/src/NCPackageSelectorPluginImpl.h
branches/tmp/bubli/ncurses-pkg/src/NCPackageSelectorStart.cc
branches/tmp/bubli/ncurses-pkg/src/NCPackageSelectorStart.h
branches/tmp/bubli/ncurses-pkg/src/NCPkgNames.cc
branches/tmp/bubli/ncurses-pkg/src/NCPkgNames.h
branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupDeps.cc
branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupDeps.h
branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupDescr.cc
branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupDescr.h
branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupDiskspace.cc
branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupDiskspace.h
branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupRepo.cc
branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupRepo.h
branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupSearch.cc
branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupSearch.h
branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupSelection.cc
branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupSelection.h
branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupTable.cc
branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupTable.h
branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupTree.cc
branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupTree.h
branches/tmp/bubli/ncurses-pkg/src/NCPkgSelMapper.cc
branches/tmp/bubli/ncurses-pkg/src/NCPkgSelMapper.h
branches/tmp/bubli/ncurses-pkg/src/NCPkgStatusStrategy.cc
branches/tmp/bubli/ncurses-pkg/src/NCPkgStatusStrategy.h
branches/tmp/bubli/ncurses-pkg/src/NCPkgTable.cc
branches/tmp/bubli/ncurses-pkg/src/NCPkgTable.h
branches/tmp/bubli/ncurses-pkg/src/NCZypp.h
branches/tmp/bubli/ncurses-pkg/src/pkg_layout.ycp
branches/tmp/bubli/ncurses-pkg/src/you_layout.ycp
branches/tmp/bubli/ncurses-pkg/yast2-ncurses-pkg.spec.in
Added: branches/tmp/bubli/ncurses-pkg/MAINTAINER
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/MAINTAINER?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/MAINTAINER (added)
+++ branches/tmp/bubli/ncurses-pkg/MAINTAINER Fri Feb 8 13:59:32 2008
@@ -0,0 +1 @@
+Katarina Machalkova
Added: branches/tmp/bubli/ncurses-pkg/Makefile.cvs
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/Makefile.cvs?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/Makefile.cvs (added)
+++ branches/tmp/bubli/ncurses-pkg/Makefile.cvs Fri Feb 8 13:59:32 2008
@@ -0,0 +1,23 @@
+#
+# Makefile.cvs
+#
+
+LIB = $(shell y2tool get-lib)
+
+PREFIX = /usr
+
+configure: all
+ ./configure --prefix=$(PREFIX) --libdir=$(PREFIX)/$(LIB)
+
+all:
+ y2tool y2autoconf
+ y2tool y2automake
+ autoreconf --force --install
+
+install: configure
+ make
+ make install
+
+reconf: all
+ ./config.status --recheck
+ ./config.status
Added: branches/tmp/bubli/ncurses-pkg/POTFILES
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/POTFILES?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/POTFILES (added)
+++ branches/tmp/bubli/ncurses-pkg/POTFILES Fri Feb 8 13:59:32 2008
@@ -0,0 +1,6 @@
+./src/NCPkgTable.cc
+./src/NCPkgPopupDiskspace.cc
+./src/NCPkgNames.cc
+./src/NCPkgPopupSearch.cc
+./src/NCPkgPopupDeps.cc
+./src/NCPackageSelector.cc
Added: branches/tmp/bubli/ncurses-pkg/RPMNAME
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/RPMNAME?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/RPMNAME (added)
+++ branches/tmp/bubli/ncurses-pkg/RPMNAME Fri Feb 8 13:59:32 2008
@@ -0,0 +1 @@
+yast2-ncurses-pkg
Added: branches/tmp/bubli/ncurses-pkg/SUBDIRS
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/SUBDIRS?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/SUBDIRS (added)
+++ branches/tmp/bubli/ncurses-pkg/SUBDIRS Fri Feb 8 13:59:32 2008
@@ -0,0 +1 @@
+src doc
Added: branches/tmp/bubli/ncurses-pkg/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/VERSION?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/VERSION (added)
+++ branches/tmp/bubli/ncurses-pkg/VERSION Fri Feb 8 13:59:32 2008
@@ -0,0 +1 @@
+2.16.14
Added: branches/tmp/bubli/ncurses-pkg/configure.in.in
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/configure.in.in?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/configure.in.in (added)
+++ branches/tmp/bubli/ncurses-pkg/configure.in.in Fri Feb 8 13:59:32 2008
@@ -0,0 +1,19 @@
+## general configure.in.in
+
+## initialize
+@YAST2-INIT-COMMON@
+@YAST2-INIT-PROGRAM@
+
+## some common checks
+@YAST2-CHECKS-COMMON@
+@YAST2-CHECKS-PROGRAM@
+
+## SUSE ncurses do not need the wide include
+## but other distros do, #201705
+AC_CHECK_HEADER([ncursesw/curses.h],
+ [CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"])
+
+PKG_CHECK_MODULES([ZYPP], [libzypp])
+
+## and generate the output
+@YAST2-OUTPUT@
Added: branches/tmp/bubli/ncurses-pkg/doc/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/doc/.cvsignore?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/doc/.cvsignore (added)
+++ branches/tmp/bubli/ncurses-pkg/doc/.cvsignore Fri Feb 8 13:59:32 2008
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
Added: branches/tmp/bubli/ncurses-pkg/doc/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/doc/Makefile.am?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/doc/Makefile.am (added)
+++ branches/tmp/bubli/ncurses-pkg/doc/Makefile.am Fri Feb 8 13:59:32 2008
@@ -0,0 +1 @@
+SUBDIRS = autodocs
Added: branches/tmp/bubli/ncurses-pkg/doc/autodocs/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/doc/autodocs/.cvsignore?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/doc/autodocs/.cvsignore (added)
+++ branches/tmp/bubli/ncurses-pkg/doc/autodocs/.cvsignore Fri Feb 8 13:59:32 2008
@@ -0,0 +1,9 @@
+Makefile
+Makefile.in
+*.html
+*.png
+*.tag
+doxygen.css
+doxygen.log
+doxygen.conf
+installdox
Added: branches/tmp/bubli/ncurses-pkg/doc/autodocs/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/doc/autodocs/Makefile.am?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/doc/autodocs/Makefile.am (added)
+++ branches/tmp/bubli/ncurses-pkg/doc/autodocs/Makefile.am Fri Feb 8 13:59:32 2008
@@ -0,0 +1,5 @@
+#
+# Makefile.am for ncurses/doc/autodocs
+#
+
+include $(top_srcdir)/autodocs-cc-off.ami
Added: branches/tmp/bubli/ncurses-pkg/package/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/package/.cvsignore?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/package/.cvsignore (added)
+++ branches/tmp/bubli/ncurses-pkg/package/.cvsignore Fri Feb 8 13:59:32 2008
@@ -0,0 +1,3 @@
+*.bz2
+*.tar.gz
+*.spec
Added: branches/tmp/bubli/ncurses-pkg/package/yast2-ncurses.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/package/yast2-ncurses.changes?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/package/yast2-ncurses.changes (added)
+++ branches/tmp/bubli/ncurses-pkg/package/yast2-ncurses.changes Fri Feb 8 13:59:32 2008
@@ -0,0 +1,2313 @@
+-------------------------------------------------------------------
+Fri Feb 1 15:49:47 CET 2008 - sh@suse.de
+
+- Moved event handling from YUI / YNCursesUI to YDialog / NCDialog
+- V 2.16.14
+
+-------------------------------------------------------------------
+Thu Jan 31 15:27:49 CET 2008 - sh@suse.de
+
+- Simplified dialog handling
+- V 2.16.13
+
+-------------------------------------------------------------------
+Thu Jan 31 14:22:36 CET 2008 - kmachalkova@suse.cz
+
+- Align numbers in IntFields to the right margin of the label, not
+ to the right margin of the entire screen (bnc#309118)
+
+-------------------------------------------------------------------
+Tue Jan 29 20:04:53 CET 2008 - sh@suse.de
+
+- YCP-less event handling
+- V 2.16.12
+
+-------------------------------------------------------------------
+Tue Jan 29 15:50:37 CET 2008 - kmachalkova@suse.cz
+
+- Delete any leftover dialogs (popups, menus) on exit from package
+ selector (bnc#354712)
+- Moved BusyIndicator widget handling to idleLoop, do not use signals
+ as they may freeze yast (libncurses and malloc are not signal-safe)
+ (bnc#355562)
+- 2.16.11
+
+-------------------------------------------------------------------
+Fri Jan 18 17:45:29 CET 2008 - kmachalkova@suse.cz
+
+- Running separate UI-thread re-enabled (adjusted idleLoop, file
+ descriptor saving/restoring) (bug #164999, FaTE #301899)
+- 2.16.10
+
+-------------------------------------------------------------------
+Tue Jan 16 16:55:00 CET 2008 - tgoettlicher@suse.de
+
+- Added BusyIndicator widget
+- 2.16.9
+
+-------------------------------------------------------------------
+Tue Jan 15 16:36:35 CET 2008 - kmachalkova@suse.cz
+
+- 'Press F1 for Help' in window title is gone
+- No Fxx keys help pop-up (all the information moved to the bottom
+ status line)
+- Fxx key labels rendered in reversed colours
+- Improved dependency conflict popup layout (Label (`opt(`outputField
+ instead of TextEntry, spacing re-arrangements) (#350238)
+
+-------------------------------------------------------------------
+Mon Jan 7 12:32:14 CET 2008 - kmachalkova@suse.cz
+
+- Status line support added ( all quick access Fxx keys are now
+ shown in the bottom status line ), help popup not removed yet
+- Fixed adding and indexing of combo-box items (#346862 related)
+- 2.16.8
+
+-------------------------------------------------------------------
+Mon Dec 17 13:10:27 CET 2007 - kmachalkova@suse.cz
+
+- Reworked repositories filter: added pref. width/height methods,
+ adding items adapted to new NCTable, treat RepoTag as dummy table cell
+- Set dialog's default button in showDialog() routine (no further
+ magic, 'last one wins' approach)
+- Adding table items modified so that it does not use static indexing
+ - exchanging table content (`Items) then misbehaves (#343870)
+- Fixed displaying of visited RichText hyperlinks in rxvt theme
+- 2.16.7
+
+-------------------------------------------------------------------
+Mon Dec 10 18:40:37 CET 2007 - sh@suse.de
+
+Moved file and directory dialogs from NCursesUI to NCApplication:
+ - askForExistingDirectory()
+ - askForExistingFile()
+ - askForSaveFile()
+- Added requires and buildRequires for yast2-core-2.16.15 to .spec
+- 2.16.6
+
+-------------------------------------------------------------------
+Tue Dec 4 17:00:16 CET 2007 - kmachalkova@suse.cz
+
+- Removed reference to printing license text (#327542)
+- Set dialog's default button correctly
+- 2.16.5
+
+-------------------------------------------------------------------
+Mon Dec 3 15:33:53 CET 2007 - kmachalkova@suse.cz
+
+- Further changes to package selector (gs)
+- NCDialog adapted to new YDialog (sh)
+- Correct setValue for CheckBox (do not forget to redraw)
+- Do not set focus to default button each time dialog layout is
+ recalculated (#343870)
+- 2.16.4
+
+-------------------------------------------------------------------
+Mon Nov 26 14:24:19 CET 2007 - kmachalkova@suse.cz
+
+- First version of YCP-less package selector (gs)
+- Fixed includes (FSize.h and YRpmGroupsTree.h now in libyui) (sh)
+- Delete any leftover dialogs in YNCursesUI destructor
+- Require new yast2-core
+- 2.16.3
+
+-------------------------------------------------------------------
+Mon Nov 26 10:26:45 CET 2007 - mvidner@suse.cz
+
+- Added missing mode for open(O_CREAT) fixing compilation with glibc-2.7.
+
+-------------------------------------------------------------------
+Thu Nov 22 21:12:05 CET 2007 - sh@suse.de
+
+- Moved setLanguage() from YUI to YApplication
+
+-------------------------------------------------------------------
+Mon Nov 19 18:14:17 CET 2007 - kmachalkova@suse.cz
+
+- Unified terminology: repositories vs. inst.sources (FaTE #302970)
+
+-------------------------------------------------------------------
+Fri Nov 16 20:23:03 CET 2007 - kmachalkova@suse.cz
+
+- The Great Merge [tm] - merged mod-ui branch into the trunk
+- 2.16.2
+
+-------------------------------------------------------------------
+Tue Oct 30 13:52:59 CET 2007 - kmachalkova@suse.cz
+
+- Explicitely set foreground (font) color to white for rxvt theme
+ (do not display black font on black background) (#336060)
+- 2.16.1
+
+-------------------------------------------------------------------
+Tue Oct 23 15:18:39 CEST 2007 - kmachalkova@suse.cz
+
+- Added missing includes to compile with gcc 4.3
+- Removed sources of gcc 4.3 operator priority warnings
+- 2.16.0
+
+-------------------------------------------------------------------
+Fri Sep 7 17:15:00 CEST 2007 - kmachalkova@suse.cz
+
+- Display install notify message only if package is marked for
+ installation, disregard update (#308410)
+- 2.15.27
+
+-------------------------------------------------------------------
+Fri Aug 24 14:18:24 CEST 2007 - kmachalkova@suse.cz
+
+- Smaller (vertical) default size of MultiLineEdit widget (partly
+ #292282)
+- Redirecting stdout/stderr to log is now separate function
+- 2.15.26
+
+-------------------------------------------------------------------
+Wed Aug 22 17:17:40 CEST 2007 - kmachalkova@suse.cz
+
+- Correct setValue for CheckBoxFrame (added missing Redraw() call)
+ (#301370)
+- Display repository name instead of product name in package
+ selector (#296782)
+- 2.15.25
+
+-------------------------------------------------------------------
+Wed Aug 15 12:50:03 CEST 2007 - jsuchome@suse.cz
+
+- messages from proofread merged back
+- 2.15.24
+
+-------------------------------------------------------------------
+Fri Aug 10 17:44:45 CEST 2007 - mvidner@suse.cz
+
+- Finished integrating Feature #120292, UI as a namespace callable
+ from yast2-*-bindings.
+- 2.15.23
+
+-------------------------------------------------------------------
+Fri Aug 10 11:34:06 CEST 2007 - kmachalkova@suse.cz
+
+- Removed redefinition of '<<' DiskUsageCounter operator, it is now
+ defined directly in libzypp
+
+-------------------------------------------------------------------
+Mon Aug 6 19:09:59 CEST 2007 - kmachalkova@suse.cz
+
+- Added text referring to whereabouts of the license text to lic.
+ agreement popup (FaTE #302018)
+- Show Filter: <product summary> after filling the repository list
+ - by gs
+- 2.15.22
+
+-------------------------------------------------------------------
+Mon Aug 6 13:56:58 CEST 2007 - mvidner@suse.cz
+
+- Adapted to changes in yast2-core needed for making UI callable from
+ yast2-*-bindings.
+- 2.15.21.1
+
+-------------------------------------------------------------------
+Thu Jul 19 13:24:01 CEST 2007 - kmachalkova@suse.cz
+
+- Make repositories list popup work (FaTE #301810 - part II) -
+ show repositories (and their products), show packages for selected
+ repository
+- Added dejagnu to BuildRequires (needed to run testsuite during pkg
+ build)
+- Changed kbd shortcut to prevent duplicates (bug #289771) - by gs
+- 2.15.21
+
+-------------------------------------------------------------------
+Tue Jul 17 09:51:36 CEST 2007 - kmachalkova@suse.cz
+
+- Require new libzypp (>= 3.11.8)
+- Correct svn merge from refactoring branch
+
+-------------------------------------------------------------------
+Mon Jul 16 17:12:46 CEST 2007 - mvidner@suse.cz
+
+- fixed changelog duplicates
+
+-------------------------------------------------------------------
+Mon Jul 16 16:27:38 CEST 2007 - kmachalkova@suse.cz
+
+- Added repositories list popup (FaTE #301810 - part II) - does
+ not do anything useful yet
+
+-------------------------------------------------------------------
+Wed Jul 4 14:40:23 CEST 2007 - gs@suse.de
+
+- adapted to libzypp-3.10
+- 2.15.20
+
+-------------------------------------------------------------------
+Thu Jun 21 17:38:48 CEST 2007 - adrian@suse.de
+
+- fix changelog entry order
+
+-------------------------------------------------------------------
+Thu Jun 14 16:41:04 CEST 2007 - kmachalkova@suse.cz
+
+- Use environment variable Y2NCURSES_COLOR_THEME to set color theme
+ of UI (FaTE #301893)
+- Added new rxvt theme (for rxvt-style terminals)
+- 2.15.19
+
+-------------------------------------------------------------------
+Thu Jun 7 17:48:20 CEST 2007 - kmachalkova@suse.cz
+
+- Do not add extra vertical space to CheckBoxFrame widget (expand
+ only horizontally so that check box fits in)
+- 2.15.18
+
+-------------------------------------------------------------------
+Wed Jun 6 13:18:39 CEST 2007 - gs@suse.de
+
+- Online Update/Package Installation: allow status change and show
+ correct version of patch packages, add installed packages to the
+ list of package versions, replace obsolete transactResKind() by
+ resolvePool()
+
+-------------------------------------------------------------------
+Thu May 31 11:00:22 CEST 2007 - gs@suse.de
+
+- Load library libpy2ncurses_pkg as plugin
+
+-------------------------------------------------------------------
+Tue May 29 13:03:07 CEST 2007 - kmachalkova@suse.cz
+
+- Removed obsolete save/load selection stuff + related NCPkgPopupFile
+ class - replaced by save/load pkgs & patterns (FaTE #300729)
+- Improved usability of cancel dialog in pkg manager (#274774)
+- Fix disappearing 'Etc./All Packages List' submenu after unchecking
+ AutoDependency Check
+- Place all popup dialogs in pkg manager to the centre of the screen
+ and calculate their size relatively to the screen size (if applicable)
+ (#275610)
+- 2.15.17
+
+-------------------------------------------------------------------
+Wed May 23 13:54:16 CEST 2007 - gs@suse.de
+
+- Package Installation: check the partition size to prevent
+ division by zero during disk space calculation (bug #270836)
+
+-------------------------------------------------------------------
+Wed May 16 13:15:56 CEST 2007 - gs@suse.de
+
+- Move all files related to package installation to subdir 'pkg'
+ and create a separate library libpy2ncurses_pkg (not yet loaded
+ as a plugin).
+
+-------------------------------------------------------------------
+Thu May 10 10:09:11 CEST 2007 - kmachalkova@suse.cz
+
+- Replace y; elements in richtext by their ascii character
+ equivalents (#269919)
+- Calculate license agreement & notify text popup size and position
+ relatively to the current screen size (#269918)
+- 2.15.16
+
+-------------------------------------------------------------------
+Wed May 2 14:44:09 CEST 2007 - gs@suse.de
+
+- Disable child widgets of a NCCheckBoxFrame correctly (bug #268352)
+
+-------------------------------------------------------------------
+Thu Apr 26 13:21:37 CEST 2007 - kmachalkova@suse.cz
+
+- For containter (Box) and alignment (Left, Right,...) widgets
+ enable/disable all the children recursively (#256707)
+- 2.15.15
+
+-------------------------------------------------------------------
+Mon Apr 23 16:24:39 CEST 2007 - kmachalkova@suse.cz
+
+- Really correct setting of current item in ComboBox widget :-)
+ consider also `opt(`editable) combos (#233593)
+
+-------------------------------------------------------------------
+Thu Apr 19 14:37:04 CEST 2007 - gs@suse.de
+
+- Enable/disable the RadioButtons in a RadioButtonGroup correctly
+ (bug #168770)
+- ncurses-devel added to BuildRequires
+- 2.15.14
+
+-------------------------------------------------------------------
+Thu Apr 19 14:12:15 CEST 2007 - kmachalkova@suse.cz
+
+- Package selector: added filter for languages (zypp::Language) -
+ beta version (FaTE #301810 - part I)
+
+-------------------------------------------------------------------
+Thu Apr 19 10:34:58 CEST 2007 - gs@suse.de
+
+- Inform the user that all dependencies/the system are/is OK after
+ a check from 'Etc.' menu (bug #249281)
+
+-------------------------------------------------------------------
+Wed Mar 21 17:19:57 CET 2007 - kmachalkova@suse.cz
+
+- Correct pkg/pattern/patch state transition from S_AutoInstall to
+ S_Taboo on toggle with SPACE key (#254816)
+- Do not set state to S_Install if no candidate is available
+- 2.15.13
+
+-------------------------------------------------------------------
+Thu Mar 8 11:09:24 CET 2007 - gs@suse.de
+
+- Don't throw away keys from the input buffer after a ValueChanged or
+ SelectionChanged event but save them e.g. for input in TextEntry,
+ MultiLineEdit or to scroll in lists ( bug #245476 )
+- 2.15.12
+
+-------------------------------------------------------------------
+Wed Mar 7 15:19:44 CET 2007 - kmachalkova@suse.cz
+
+- Tree widget: handle arrows and HOME/END keys in compatible way
+ with other widgets (#251216)
+
+-------------------------------------------------------------------
+Tue Mar 6 10:10:33 CET 2007 - kmachalkova@suse.cz
+
+- initscr() code is back - needed for running yast clients from
+ scripts with no terminal associated (#248864)
+- 2.15.11
+
+-------------------------------------------------------------------
+Fri Mar 2 11:11:50 CET 2007 - kmachalkova@suse.cz
+
+- Replaced 'Solve' label with 'OK -- Try again' in pkg manager (to
+ be compatible with Qt), enhanced help text (#213602)
+- 2.15.10
+
+-------------------------------------------------------------------
+Thu Mar 1 14:30:28 CET 2007 - gs@suse.de
+
+- Replace &product; in RichText widget correctly (bug #247845)
+
+-------------------------------------------------------------------
+Thu Feb 22 12:43:06 CET 2007 - gs@suse.de
+
+- Online Update: Add column with patch version and show the version in
+ the description window (bug #239829)
+- 2.15.9
+
+-------------------------------------------------------------------
+Wed Feb 21 13:00:58 CET 2007 - kmachalkova@suse.cz
+
+- Show 'automatic changes' popup when any pkgs are selected for
+ installation by 'verify system' call (#239750)
+- Remember pkgs already marked for automatic installation by 'verify
+ system' and do not show them in 'automatic changes' popup again
+- 2.15.8
+
+-------------------------------------------------------------------
+Wed Feb 14 16:00:23 CET 2007 - kmachalkova@suse.cz
+
+- Use generic xterm/vt100 termifo in case required terminfo is missing
+ (#235954)
+- Removed obsolete initscr() code
+- 2.15.7
+
+-------------------------------------------------------------------
+Tue Feb 6 16:47:59 CET 2007 - kmachalkova@suse.cz
+
+- Correct setting of current item in ComboBox widget (#233593)
+
+-------------------------------------------------------------------
+Thu Feb 1 14:55:33 CET 2007 - gs@suse.de
+
+- Online Update: Show patch name (ID) in patches list (bug #239829)
+- 2.15.6
+
+-------------------------------------------------------------------
+Wed Jan 17 16:27:05 CET 2007 - kmachalkova@suse.cz
+
+- Substitute right arrows back for tab characters when querying
+ content of MultiLineEdit widget (mostly) (#142509)
+- 2.15.5
+
+-------------------------------------------------------------------
+Tue Jan 16 13:18:17 CET 2007 - gs@suse.de
+
+- Spec file: Requires: libzypp >= 2.12.1
+- Improve CheckBoxFrame widget (related to Fate #5673)
+- Add argument to verifySystem() call (related to Fate #301178)
+
+-------------------------------------------------------------------
+Fri Jan 12 14:21:51 CET 2007 - gs@suse.de
+
+- CheckBoxFrame widget added (Fate #5673)
+
+-------------------------------------------------------------------
+Wed Jan 10 17:46:18 CET 2007 - kmachalkova@suse.cz
+
+- Added functionality to export/import list of all packages and
+ patterns to xml file (FaTE #300729)
+- 2.15.4
+
+-------------------------------------------------------------------
+Thu Jan 4 12:52:56 CET 2007 - kmachalkova@suse.cz
+
+- Added functionality to update list of pkgs if newer version is
+ available (#227043)
+- Improved switching between states of pkgs (install->don't install
+ update->don't update) (partly #204072)
+- 2.15.3
+
+-------------------------------------------------------------------
+Tue Dec 12 13:09:06 CET 2006 - gs@suse.de
+
+- Package Installation: add functionality 'Verify System' to Etc./
+ Dependencies menu (Fate #301178)
+- Online Update: patch searching ability added to Filter menu
+ (Fate #153197)
+- 2.15.2
+
+-------------------------------------------------------------------
+Tue Dec 5 10:33:13 CET 2006 - kmachalkova@suse.cz
+
+- Added RunInTerminal UI builtin for running external programs in
+ the same terminal
+- 2.15.1
+
+-------------------------------------------------------------------
+Tue Dec 5 09:52:49 CET 2006 - kmachalkova@suse.cz
+
+- Use the same color palette - 8 colors - for all terminals (thanks
+ to tiwai) (#221614)
+- Highlight keyboard shortcuts in mono theme (#224892)
+- 2.15.0
+
+-------------------------------------------------------------------
+Wed Nov 29 16:55:14 CET 2006 - kmachalkova@suse.cz
+
+- Display updated patches also in 'installable' view (not only in
+ 'installed' one) (#223416)
+- 2.14.4
+
+-------------------------------------------------------------------
+Fri Nov 24 16:00:42 CET 2006 - kmachalkova@suse.cz
+
+- Reverted fix for refreshing screen in installation (#199256)
+- More space for filter description in package selector (#222549)
+- 2.14.3
+
+-------------------------------------------------------------------
+Tue Nov 7 14:37:38 CET 2006 - gs@suse.de
+
+- Package Installation/Online Update: added support for resolver
+ test case generation, additional entry 'Etc.' menu (Fate #300756)
+- 2.14.2
+
+-------------------------------------------------------------------
+Thu Nov 2 14:32:53 CET 2006 - gs@suse.de
+
+- Online update: Improved list of relevant patches (bug #168758)
+- 2.14.1
+
+-------------------------------------------------------------------
+Tue Oct 31 16:25:47 CET 2006 - kmachalkova@suse.cz
+
+- (Temporary) fix for refreshing screen during the installation
+ (#199256)
+- Adjusted spec to require libzypp >=2.7.0 (zypp::ui::PatternContent)
+- 2.14.0
+
+-------------------------------------------------------------------
+Mon Oct 30 12:48:44 CET 2006 - gs@suse.de
+
+- Package Installation: Fold hidden patterns into parents (Fate #301229)
+- Online Update: show list of installable (relevant) patches
+ (bug # 168758)
+- 2.13.47
+
+-------------------------------------------------------------------
+Wed Oct 11 11:30:57 CEST 2006 - gs@suse.de
+
+- Online Update: Allow deletion of patches (bug #208694)
+ Package Installation: change status to delete if '-' is pressed,
+ use % key to reset taboo status (bug #204072)
+- 2.13.46
+
+-------------------------------------------------------------------
+Tue Oct 10 10:02:32 CEST 2006 - gs@suse.de
+
+- Package Installation: Show low disk space warning similiar to
+ QT version (FaTE #300548)
+- 2.13.45
+
+-------------------------------------------------------------------
+Wed Sep 27 13:44:11 CEST 2006 - kmachalkova@suse.cz
+
+- Better displaying of visited hyperlinks in NCRichText (#144428)
+- 2.13.44
+
+-------------------------------------------------------------------
+Mon Sep 18 13:17:22 CEST 2006 - kmachalkova@suse.cz
+
+- Improved HTML parser in NCRichText (header, paragraph and list
+ handling) (FaTE #3124)
+- 2.13.43
+
+-------------------------------------------------------------------
+Thu Sep 14 14:40:07 CEST 2006 - gs@suse.de
+
+- Package Installation: default entry in filter menu is 'Patterns'
+- 2.13.42
+
+-------------------------------------------------------------------
+Thu Sep 14 11:17:50 CEST 2006 - kmachalkova@suse.cz
+
+- Adding ncursesw autoconf check to configure.in.in to ensure
+ portability to other distros (#201705)
+
+-------------------------------------------------------------------
+Thu Sep 14 10:59:56 CEST 2006 - gs@suse.de
+
+- Package Installation: search in the "provides" tag of the installed
+ package (bug #180232)
+
+-------------------------------------------------------------------
+Wed Sep 13 16:42:39 CEST 2006 - sh@suse.de
+
+- Applied patch from Ricardo Cruz
+ for new UI::Beep() built-in
+
+-------------------------------------------------------------------
+Tue Sep 12 14:36:02 CEST 2006 - gs@suse.de
+
+- Package Installation: show details of package and pattern
+ dependencies (bug #178494, bug #201745)
+- 2.13.41
+
+-------------------------------------------------------------------
+Tue Jun 20 14:49:52 CEST 2006 - gs@suse.de
+
+- Online Update: don't show the patch size (bug #186100);
+ show the patch summary, if available, else the name of the patch
+ (bug #186209).
+- 2.13.40
+
+-------------------------------------------------------------------
+Mon Jun 12 17:46:25 CEST 2006 - mvidner@suse.cz
+
+- Fixed the previous fix not to pass milliseconds to usleep.
+- 2.13.39
+
+-------------------------------------------------------------------
+Mon Jun 12 17:16:39 CEST 2006 - visnov@suse.cz
+
+- If there is no active widget and we are running against timeout,
+ really timeout (#182982)
+- 2.13.38
+
+-------------------------------------------------------------------
+Fri Jun 9 14:36:07 CEST 2006 - visnov@suse.cz
+
+- Redraw the screen after updating the text entry value (#167609)
+- 2.13.37
+
+-------------------------------------------------------------------
+Fri Jun 2 17:21:59 CEST 2006 - gs@suse.de
+
+- Online Update: make resetting of status Taboo and Protected
+ possible (related to bug #174476)
+- 2.13.36
+
+-------------------------------------------------------------------
+Tue May 30 11:57:06 CEST 2006 - gs@suse.de
+
+- Added support for licenses for patches (bug #174476)
+- 2.13.35
+
+-------------------------------------------------------------------
+Mon May 22 10:10:25 CEST 2006 - gs@suse.de
+
+- Check whether the window pointer is valid in ::wCreate
+ to prevent a segfault if the terminal is too small
+ (bug #175920)
+- 2.13.34
+
+-------------------------------------------------------------------
+Fri May 19 14:19:18 CEST 2006 - gs@suse.de
+
+- Package Installation: Sort the pattern list (bug #176603)
+- 2.13.33
+
+-------------------------------------------------------------------
+Thu May 18 10:48:27 CEST 2006 - kkaempf@suse.de
+
+- adapt to libzypp 1.0.0 api
+- require libzypp >= 1.0.0
+- 2.13.32
+
+-------------------------------------------------------------------
+Wed May 17 17:51:48 CEST 2006 - gs@suse.de
+
+- Package Installation/Online Update: Install correct package if the user
+ requests a certain package version, i.e. changing the "candidate".
+ Add view 'Versions' to Online Update 'Information' menu.
+ (bug #164487)
+- 2.13.31
+
+-------------------------------------------------------------------
+Wed May 10 14:16:52 CEST 2006 - gs@suse.de
+
+- Package Installation dialag: Create appropriate 'Filter' menu
+ with 'Patterns' or 'Selections' (bug #171024, bug #173885)
+- 2.13.30
+
+-------------------------------------------------------------------
+Tue May 9 14:57:04 CEST 2006 - gs@suse.de
+
+- show "Automatic Changes List" correctly (bug #152700)
+- 2.13.29
+
+-------------------------------------------------------------------
+Thu May 4 14:21:09 CEST 2006 - gs@suse.de
+
+- messages from proofread merged back
+- 2.13.28
+
+-------------------------------------------------------------------
+Wed May 3 11:12:03 CEST 2006 - gs@suse.de
+
+- Online Update: show text "No patches available" if the patch list is empty
+- 2.13.27
+
+-------------------------------------------------------------------
+Tue Apr 25 14:15:51 CEST 2006 - gs@suse.de
+
+- bugfix for #167565 - UI: deselecting one preselected pattern deselects
+ everything (add transactResKind( zypp::ResTraitszypp::Product::kind )
+- 2.13.26
+
+-------------------------------------------------------------------
+Mon Apr 24 13:53:54 CEST 2006 - gs@suse.de
+
+- bugfix for list of problematic update items (add installed
+ packages to SelMapper to show packages marked auto-delete)
+- Online Update: don't show label 'Installable Patches'
+- 2.13.25
+
+-------------------------------------------------------------------
+Fri Apr 21 08:05:44 CEST 2006 - gs@suse.de
+
+- list of problematic update items added
+- handle Auto status for patches
+- 2.13.24
+
+-------------------------------------------------------------------
+Thu Apr 20 17:34:24 CEST 2006 - gs@suse.de
+
+- Don't show the "Automatic Changes" list in Online Update mode
+- 2.13.23
+
+-------------------------------------------------------------------
+Thu Apr 20 12:51:19 CEST 2006 - mvidner@suse.cz
+
+- Catch exceptions when calling package management code (#166278).
+- 2.13.22
+
+-------------------------------------------------------------------
+Wed Apr 19 12:38:55 CEST 2006 - gs@suse.de
+
+- set status of packages correctly (Bug 164365)
+- do an initial solver run also in YOU mode
+- sort the list of patches, show edition of patch packages
+- 2.13.21
+
+-------------------------------------------------------------------
+Wed Apr 12 12:21:10 CEST 2006 - gs@suse.de
+
+- also set status to Taboo in case of AutoInstall and to Protected
+ in case of AutoUpdate (bugfix for bugfix bug #163827)
+- 2.13.20
+
+-------------------------------------------------------------------
+Tue Apr 11 14:31:55 CEST 2006 - gs@suse.de
+
+- check for pending licenses (bug #163827)
+- 2.13.19
+
+-------------------------------------------------------------------
+Mon Apr 10 14:57:05 CEST 2006 - gs@suse.de
+
+- Fixed inconsistent propagation of installation status of packages
+ that belong to selections, patterns, languages etc.
+- show/check dependencies also in YOU mode
+- 2.13.18
+
+-------------------------------------------------------------------
+Fri Apr 7 08:05:46 CEST 2006 - gs@suse.de
+
+- solve pattern/selection dependencies correctly (bug #161400),
+ show architecture in versions view
+- 2.13.17
+
+-------------------------------------------------------------------
+Wed Mar 29 14:44:34 CEST 2006 - gs@suse.de
+
+- Show/set correct status information for packages in versions view
+ (available packages)
+- 2.13.16
+
+-------------------------------------------------------------------
+Tue Mar 28 13:26:14 CEST 2006 - gs@suse.de
+
+- YOU patch installation: avoid duplicate entries in package list,
+ show download size, show scripts
+- 2.13.15
+
+-------------------------------------------------------------------
+Mon Mar 27 15:00:00 CET 2006 - gs@suse.de
+
+- make YOU patch installation work
+- 2.13.14
+
+-------------------------------------------------------------------
+Mon Mar 13 15:03:55 CET 2006 - mvidner@suse.cz
+
+- Added license confirmations (#151834).
+- Show the list of automatically changed packages (#152700#c1).
+- Show the list of update problems: Protected, Taboo, AutoDeleted.
+- 2.13.13
+
+-------------------------------------------------------------------
+Fri Mar 10 10:30:38 CET 2006 - mvidner@suse.cz
+
+- Messages for the package conflict dialog marked for translation.
+
+-------------------------------------------------------------------
+Fri Mar 3 16:59:29 CET 2006 - mvidner@suse.cz
+
+- Disk usage display fixed (#152269).
+- 2.13.12
+
+-------------------------------------------------------------------
+Mon Feb 27 16:26:57 CET 2006 - mvidner@suse.cz
+
+- Sort packages in a selection.
+- No need to resolve the pool again before displaying the packages
+ in a selection.
+- Hid menu items of features that do not work:
+ SRPMs, Selection Load/Save.
+- Only show the Installed Version column if any packages are installed.
+- Do not show '?' in the Source column.
+- 2.13.11
+
+-------------------------------------------------------------------
+Fri Feb 24 17:08:09 CET 2006 - mvidner@suse.cz
+
+- Tried to allow selecting one of the available package versions.
+- When canceling the package selection, ask for confirmation
+ only if the user has changed something (but see #152700).
+
+-------------------------------------------------------------------
+Wed Feb 22 17:51:38 CET 2006 - mvidner@suse.cz
+
+- When exiting the package dialog, show packages which are
+ automatically selected for installation (but see #152700).
+- Display the RPM group tree.
+- Display package relations, enable search in requires and provides.
+- Display the available versions of a package.
+- 2.13.10
+
+-------------------------------------------------------------------
+Wed Feb 22 07:50:37 CET 2006 - mvidner@suse.cz
+
+- Fixed displaying the shortcut keys for wide characters (#148380, tiwai).
+
+-------------------------------------------------------------------
+Tue Feb 21 15:15:38 CET 2006 - mvidner@suse.cz
+
+- Do not package the doxygen documentation, it is only useful for the
+ maintainer (#151370).
+- 2.13.9
+
+-------------------------------------------------------------------
+Fri Feb 17 11:29:30 CET 2006 - mvidner@suse.cz
+
+- If patterns are available, display them instead of selections.
+
+-------------------------------------------------------------------
+Thu Feb 16 21:03:54 CET 2006 - mvidner@suse.cz
+
+- Show something in the update problem list, for now
+ just the deleted packages.
+- Prepare for detecting whether the user has made any changes
+ upon abort.
+- 2.13.8
+
+-------------------------------------------------------------------
+Thu Feb 16 18:34:35 CET 2006 - mvidner@suse.cz
+
+- Added the selection list.
+- Most popups should work now, some with faked data though.
+- Show also medium ID and RPM group.
+- 2.13.7
+
+-------------------------------------------------------------------
+Wed Feb 15 18:32:35 CET 2006 - mvidner@suse.cz
+
+- Show most package details.
+- Search works, except in dependencies.
+- 2.13.6.4
+
+-------------------------------------------------------------------
+Wed Feb 15 17:05:00 CET 2006 - mvidner@suse.cz
+
+- Dependency solver ported.
+- Reduced BuildReqs, libzypp-devel has them now.
+- 2.13.6.3
+
+-------------------------------------------------------------------
+Tue Feb 14 13:45:21 CET 2006 - mvidner@suse.cz
+
+- Minimal zypp support:
+ * One list with all packages.
+ * Can change status. No popups and no details.
+ * If there are package conflicts, they will be ignored by the UI
+ and the actual installation will fail (with a misleading popup,
+ but the logs have it right).
+- 2.13.6.2
+
+-------------------------------------------------------------------
+Fri Feb 10 12:18:21 CET 2006 - mvidner@suse.cz
+
+- Ripped out all package related stuff: y2pm out, zypp not yet in (#149879)
+- 2.13.6
+
+-------------------------------------------------------------------
+Tue Jan 24 16:59:49 CET 2006 - visnov@suse.cz
+
+- Disable sorting in non-YTable (#143085)
+- V 2.13.5
+
+-------------------------------------------------------------------
+Tue Jan 17 14:13:47 CET 2006 - sh@suse.de
+
+- Fixed bug #77920: Not stripping shortcut from frame
+ ("Network Address Setup dialog cannot be finished by a hotkey")
+- V 2.13.4
+
+-------------------------------------------------------------------
+Mon Jan 9 13:19:12 CET 2006 - visnov@suse.cz
+
+- Allow to set table order by Ctrl-O
+- V 2.13.3
+
+-------------------------------------------------------------------
+Tue Dec 20 08:59:15 CET 2005 - visnov@suse.cz
+
+- Don't link against libpy2stdio
+- V 2.13.2
+
+-------------------------------------------------------------------
+Thu Nov 24 12:57:45 CET 2005 - visnov@suse.cz
+
+- Fix strict aliasing warnings
+- V 2.13.1
+
+-------------------------------------------------------------------
+Mon Oct 10 16:41:42 CEST 2005 - visnov@suse.cz
+
+- Fix compilation for GCC 4.1
+- V 2.13.0
+
+-------------------------------------------------------------------
+Thu Aug 11 10:51:32 CEST 2005 - visnov@suse.cz
+
+- Resolve entities even in <pre> (#71718)
+- V 2.12.6
+
+-------------------------------------------------------------------
+Wed Aug 10 14:11:45 CEST 2005 - visnov@suse.cz
+
+- Don't crash on pressing Esc in AskForExistingDirectory (#96141)
+
+-------------------------------------------------------------------
+Mon Jul 11 17:23:53 CEST 2005 - sh@suse.de
+
+- Fixed bug #95722: No items in NCurses MultiSelectionBox
+- V 2.12.5
+
+-------------------------------------------------------------------
+Mon Jul 11 08:57:51 CEST 2005 - visnov@suse.cz
+
+- Fix build dependencies
+- 2.12.4
+
+-------------------------------------------------------------------
+Tue May 10 17:38:06 CEST 2005 - mlazar@suse.cz
+
+- 2.12.3
+
+-------------------------------------------------------------------
+Fri Apr 15 13:40:34 CEST 2005 - visnov@suse.cz
+
+- gcc4 fixes
+- 2.12.2
+
+-------------------------------------------------------------------
+Wed Apr 13 14:49:13 UTC 2005 - mlazar@suse.cz
+
+- fixed bug 75269 - Can't select different versions of available kernels packages
+
+-------------------------------------------------------------------
+Wed Mar 16 10:54:12 CET 2005 - mlazar@suse.cz
+
+- 2.12.1
+- implemented feature 100313: Allow switching of color palette at
+ runtime in ncurses
+
+-------------------------------------------------------------------
+Mon Mar 14 16:19:15 CET 2005 - mlazar@suse.cz
+
+- fixed Bug 71815 - yast: unnecessary warning in packager (ncurses)
+
+-------------------------------------------------------------------
+Mon Mar 14 15:49:25 CET 2005 - mlazar@suse.cz
+
+- NCTextPad.cc: fixed bug 66104: off-by-one error in autoyast
+- NCRichText.cc: silently discards all unknown tags (see bug 67319)
+
+-------------------------------------------------------------------
+Mon Mar 7 17:20:30 CET 2005 - mlazar@suse.cz
+
+- 2.12.0
+- fixed bug 67350 - Can't change RPM group in NCurses package manager
+ (reverted patch from Tue Nov 23 16:28:41 CET 2004; see also bug 46154)
+
+-------------------------------------------------------------------
+Thu Feb 17 16:25:49 CET 2005 - mlazar@suse.cz
+
+- 2.11.3
+- redirected stderr and stdout do log (see bug 42155)
+
+-------------------------------------------------------------------
+Fri Jan 21 10:31:45 CET 2005 - mlazar@suse.cz
+
+- 2.11.2
+
+-------------------------------------------------------------------
+Tue Nov 23 16:28:41 CET 2004 - mlazar@suse.cz
+
+- KEY_RETURN open/close subtree in TreeWidget (#31154)
+
+-------------------------------------------------------------------
+Tue Nov 23 15:49:51 CET 2004 - mlazar@suse.cz
+
+- KEY_SPACE open/close subtree in TreeWidget (#31154)
+
+-------------------------------------------------------------------
+Mon Nov 1 10:06:52 CET 2004 - mvidner@suse.cz
+
+- Added pkgconfig support.
+- 2.11.1
+
+-------------------------------------------------------------------
+Wed Oct 6 16:48:14 CEST 2004 - sh@suse.de
+
+- Dropped support for hardcoded images "suseheader" and "yast2"
+ Use path names and/or the wizard instead!
+
+-------------------------------------------------------------------
+Tue Sep 21 09:45:43 CEST 2004 - mlazar@suse.cz
+
+- don't display empty ComboBox (bug #45542)
+
+-------------------------------------------------------------------
+Mon Sep 20 14:14:46 CEST 2004 - mlazar@suse.cz
+
+- 2.10.5
+
+-------------------------------------------------------------------
+Fri Sep 17 10:41:22 CEST 2004 - mlazar@suse.cz
+
+- bug #27296 fixed again
+
+-------------------------------------------------------------------
+Wed Sep 15 16:56:19 CEST 2004 - sh@suse.de
+
+- V 2.10.4
+- Added huge numbers (long long) support (YCPInteger is long long)
+ (fix for bug #44680: Progress bar in NCurses UI shows bogus values)
+
+
+-------------------------------------------------------------------
+Tue Sep 14 11:28:39 CEST 2004 - mlazar@suse.cz
+
+- temporary reverted fix #27296 (not completly fixed)
+- removed yast2 from needforbuild
+- 2.10.3
+
+-------------------------------------------------------------------
+Tue Sep 7 14:40:40 CEST 2004 - mlazar@suse.cz
+
+- fixed nicesize in SelectionBox
+
+-------------------------------------------------------------------
+Tue Sep 7 14:15:15 CEST 2004 - mlazar@suse.cz
+
+- fixed Bugzilla Bug 27296 - provider name displayed wrong
+
+-------------------------------------------------------------------
+Tue Sep 7 11:50:39 CEST 2004 - mlazar@suse.cz
+
+- fixed Bugzilla Bug 44561 - ncurses: weird menu behavior
+
+-------------------------------------------------------------------
+Tue Sep 7 09:31:20 CEST 2004 - mlazar@suse.cz
+
+- fixed bug created during fixing previous bug
+
+-------------------------------------------------------------------
+Mon Sep 6 18:28:18 CEST 2004 - mlazar@suse.cz
+
+- fixed bug #44559 and #44575 - wizard menu in curses is not shown
+- 2.10.2
+
+-------------------------------------------------------------------
+Mon Sep 6 18:08:04 CEST 2004 - mlazar@suse.cz
+
+- fixed bug when activate resized panel with new state same as old
+ state (in this case panel was not showed)
+
+-------------------------------------------------------------------
+Mon Sep 6 16:43:58 CEST 2004 - mlazar@suse.cz
+
+- 2.10.1
+
+-------------------------------------------------------------------
+Mon Sep 6 10:08:23 CEST 2004 - mlazar@suse.cz
+
+- patch for confirming license (Bugzilla Bug 44145)
+
+-------------------------------------------------------------------
+Wed Jul 21 11:14:52 CEST 2004 - mlazar@suse.cz
+
+- fixed Bugzilla Bug 35409 - `Top( `Frame() ) without top left corner
+
+-------------------------------------------------------------------
+Fri Jul 16 15:05:26 CEST 2004 - mlazar@suse.cz
+
+- fixed Bugzilla Bug 43005 - Hardware information not shown in ncurses mode
+
+-------------------------------------------------------------------
+Thu Jul 8 11:16:29 CEST 2004 - mlazar@suse.cz
+
+- fixed bug #42736: file selection dialog does not show large files (>1GB)
+
+-------------------------------------------------------------------
+Tue Jun 22 16:09:55 CEST 2004 - mlazar@suse.cz
+
+- fixed bug #42327 (yast2-ncurses abort when resizing window)
+
+-------------------------------------------------------------------
+Thu Jun 17 10:24:25 CEST 2004 - mlazar@suse.cz
+
+- V 2.10.0
+- Merged the 9.1 branch
+
+-------------------------------------------------------------------
+Wed May 26 10:59:52 CEST 2004 - gs@suse.de
+
+- V 2.9.26
+- sort the list of package selections (bug #38766)
+
+-------------------------------------------------------------------
+Wed May 12 12:27:55 CEST 2004 - gs@suse.de
+
+- V 2.9.25
+- handle empty string correctly in NCstring recode methods (bug #40165)
+
+-------------------------------------------------------------------
+Fri May 7 11:45:20 CEST 2004 - gs@suse.de
+
+- V 2.9.24
+- file selection: don't overwrite given file name (bug #39189)
+
+-------------------------------------------------------------------
+Fri Apr 23 14:42:12 CEST 2004 - gs@suse.de
+
+- V 2.9.23
+- file selection: get correct directory and file name (bug #39189)
+- LogView widget: limited size for window (bug #39536)
+- prevent the handling of invalid widgets (bug #38700, #37768)
+
+-------------------------------------------------------------------
+Tue Apr 20 14:22:49 CEST 2004 - mvidner@suse.cz
+
+- link against libyui to make loading from Perl work (#39192)
+- 2.9.22
+
+-------------------------------------------------------------------
+Tue Apr 13 15:00:29 CEST 2004 - gs@suse.de
+
+- V 2.9.21
+- accept non-latin1 characters (bug #38348)
+
+-------------------------------------------------------------------
+Mon Apr 5 13:45:22 CEST 2004 - gs@suse.de
+
+- V 2.9.20
+- ignore Ctrl C (bug #37960)
+- show title help line correctly (bug #38173)
+
+-------------------------------------------------------------------
+Fri Apr 2 14:52:12 CEST 2004 - gs@suse.de
+
+- V 2.9.19
+- deactivate logging (bug #37768)
+- bugfix in RichText for <pre> tag
+- license changed to GPL
+
+-------------------------------------------------------------------
+Fri Mar 26 15:45:38 CET 2004 - gs@suse.de
+
+- V 2.9.18
+- YOU mode: bugfix filter for patch kind
+- possibility to disable/enable RichText widget
+
+-------------------------------------------------------------------
+Mon Mar 22 16:05:47 CET 2004 - gs@suse.de
+
+- V 2.9.17
+- use correct encoding for title help (bug #36506)
+
+-------------------------------------------------------------------
+Fri Mar 19 16:55:38 CET 2004 - gs@suse.de
+
+- V 2.9.16
+- file selection: check for valid group and user (bug #36556)
+
+-------------------------------------------------------------------
+Fri Mar 19 15:45:59 CET 2004 - sh@suse.de
+
+- Graceful handling for duplicate entries in combo box
+
+-------------------------------------------------------------------
+Tue Mar 16 14:09:57 CET 2004 - gs@suse.de
+
+- package installation: improve license popup (bug #33584),
+ check size of popups (bug #35873),
+ bugfix package selections (bug #36541)
+
+-------------------------------------------------------------------
+Mon Mar 15 17:59:48 CET 2004 - gs@suse.de
+
+- V 2.9.15
+- show license (EULA), bug #33584
+
+-------------------------------------------------------------------
+Fri Mar 12 23:23:32 CET 2004 - sh@suse.de
+
+- V 2.9.14
+- Adapted to const ref fix in libyui for all widget constructors
+
+-------------------------------------------------------------------
+Fri Mar 12 13:53:47 CET 2004 - gs@suse.de
+
+- V 2.9.13
+- bugfix setfont options (YNCursesUI::setConsoleFont)
+
+-------------------------------------------------------------------
+Wed Mar 10 12:57:49 CET 2004 - lnussel@suse.de
+
+- package installation: handle downgrade case in dependency popup
+
+-------------------------------------------------------------------
+Fri Mar 5 10:01:14 CET 2004 - gs@suse.de
+
+- V 2.9.12
+- missing #include added
+
+-------------------------------------------------------------------
+Wed Mar 3 16:01:49 CET 2004 - gs@suse.de
+
+- V 2.9.11
+- messages from proofread merged back
+- show text cursor correctly (bug #35055)
+
+-------------------------------------------------------------------
+Mon Mar 1 14:26:00 CET 2004 - gs@suse.de
+
+- V 2.9.10
+- package installation: sort list of search results (bug #35060)
+- RichText: change colors for bold text and headline (bug #34410)
+
+-------------------------------------------------------------------
+Fri Feb 27 13:45:51 CET 2004 - visnov@suse.cz
+
+- V 2.9.9
+- adapted for the new counted pointers in core
+
+-------------------------------------------------------------------
+Sun Feb 22 21:30:40 CET 2004 - kkaempf@suse.de
+
+- dont redeclare package pointers
+- 2.9.8
+
+-------------------------------------------------------------------
+Fri Feb 20 10:32:50 CET 2004 - gs@suse.de
+
+- V 2.9.7
+- enable the use of cursor keys in radio button boxes
+
+-------------------------------------------------------------------
+Wed Feb 4 11:31:41 CET 2004 - gs@suse.de
+
+- V 2.9.6
+- change layout files for package/patch installation to work with NI
+- remove workaround for missing ACS chars
+
+-------------------------------------------------------------------
+Thu Jan 29 19:46:54 CET 2004 - sh@suse.de
+
+- Fixed Y2Component handling (cmd line args etc.)
+
+-------------------------------------------------------------------
+Thu Jan 29 16:42:13 CET 2004 - arvin@suse.de
+
+- V 2.9.5
+- fixed for ncurses 5.4
+
+-------------------------------------------------------------------
+Tue Jan 27 17:32:22 CET 2004 - sh@suse.de
+
+- V 2.9.4
+- Reasonable and consistent naming (new interpreter components etc.)
+
+-------------------------------------------------------------------
+Fri Jan 16 15:59:46 CET 2004 - jsrain@suse.de
+
+- merged the new interpreter branch
+
+-------------------------------------------------------------------
+Fri Dec 12 20:46:22 CET 2003 - msvec@suse.cz
+
+- adapted for the logging changes in liby2util
+- 2.9.3
+
+-------------------------------------------------------------------
+Fri Nov 21 14:03:01 CET 2003 - gs@suse.de
+
+- V 2.9.2
+- don't draw the outer frame in full screen mode
+- package installation: show column headers for all package lists
+
+-------------------------------------------------------------------
+Wed Nov 12 16:03:51 CET 2003 - gs@suse.de
+
+- V 2.9.1
+- provide file selection widgets
+- create KeyEvents
+- switch to doxygen
+
+-------------------------------------------------------------------
+Mon Sep 22 11:24:32 CEST 2003 - gs@suse.de
+
+- V 2.8.19
+- remove blinking from progress bar (bug #31454)
+- show correct patch size in YOU mode (bug #31522)
+
+-------------------------------------------------------------------
+Fri Sep 19 12:20:05 CEST 2003 - gs@suse.de
+
+- V 2.8.18
+- Requires: glibc-locale added to spec-file
+
+-------------------------------------------------------------------
+Fri Sep 12 15:28:42 CEST 2003 - gs@suse.de
+
+- V 2.8.17
+- bugfix in RichText widget (bug #30621)
+- cut lines in LogView widget (don't allocate too much memory)
+- don't use ACS chars on console if locale is not UTF-8 (bug #30512)
+- new style for ProgressBar
+
+-------------------------------------------------------------------
+Mon Sep 8 16:34:57 CEST 2003 - gs@suse.de
+
+- V 2.8.16
+- new style for not active selection box widget (bug #30035)
+
+-------------------------------------------------------------------
+Fri Sep 05 17:12:48 CEST 2003 - arvin@suse.de
+
+- don't allocate tmp buffer on stack (can be too huge) (bug #29716)
+
+-------------------------------------------------------------------
+Tue Sep 2 16:29:03 CEST 2003 - gs@suse.de
+
+- online udpate: show included scripts and files
+- don't return `cancel after window resize (bug #29853)
+
+-------------------------------------------------------------------
+Thu Aug 28 13:54:17 CEST 2003 - gs@suse.de
+
+- V 2.8.15
+- bugfix for wide character support in RichText widget
+ (get correct width of text)
+- online update: default is list of installable patches
+
+-------------------------------------------------------------------
+Thu Aug 25 15:38:31 CEST 2003 - gs@suse.de
+
+- V 2.8.14
+- package installation: support a link to a related package
+ in the package description, bugfix two line messages
+- Y2NCursesUI: set environment variable LC_CTYPE
+
+-------------------------------------------------------------------
+Fri Aug 18 16:15:52 CEST 2003 - gs@suse.de
+
+- V 2.8.13
+- RichText: support <pre> tag
+
+-------------------------------------------------------------------
+Tue Aug 12 16:14:18 CEST 2003 - gs@suse.de
+
+- V 2.8.12
+- bugfix in constructor of NCPopup...-classes (don't add child
+ widgets twice)
+
+-------------------------------------------------------------------
+Mon Aug 11 13:26:07 CEST 2003 - gs@suse.de
+
+- V 2.8.11
+- texts from proofread patched back
+- SelectionBox returns ValueChanged event
+- show patch/package description on KEY_PPAGE/KEY_NPAGE
+
+-------------------------------------------------------------------
+Tue Aug 5 13:17:42 CEST 2003 - gs@suse.de
+
+- V 2.8.10
+- get correct encoding in setConsoleFont(),
+- setKeyboard() added
+
+-------------------------------------------------------------------
+Mon Jul 28 11:49:50 CEST 2003 - gs@suse.de
+
+- V 2.8.9
+- support &product; in RichText (automatically replace the product info)
+
+-------------------------------------------------------------------
+Fri Jul 25 15:30:53 CEST 2003 - gs@suse.de
+
+- V 2.8.8
+- set terminal encoding in constructor Y2NCursesUI::Y2NCursesUI;
+
+-------------------------------------------------------------------
+Wed Jul 16 14:47:27 CEST 2003 - gs@suse.de
+
+- V 2.8.7
+- fix RPM build error: Installed (but unpackaged) file(s) found:
+ /usr/lib/YaST2/bin/y2ncurses
+
+-------------------------------------------------------------------
+Wed Jul 16 13:28:56 CEST 2003 - gs@suse.de
+
+- V 2.8.6
+- remove obsolete enum from Y2NCursesUI.h
+
+-------------------------------------------------------------------
+Wed Jul 9 14:59:34 CEST 2003 - gs@suse.de
+
+- V 2.8.5
+- adapt ncurses-UI to UTF-8 support
+- use advanced event handling
+
+-------------------------------------------------------------------
+Wed May 28 14:13:53 CEST 2003 - ma@suse.de
+
+- V 2.8.4
+- Fixes for creating and drawing dialogs on verry small terminals.
+
+-------------------------------------------------------------------
+Tue May 27 18:14:32 CEST 2003 - ma@suse.de
+
+- V 2.8.3
+- Prettify dialog shaddows (#27018)
+
+-------------------------------------------------------------------
+Mon May 26 16:57:54 CEST 2003 - ma@suse.de
+
+- V 2.8.2
+- Fixed handling of resize events (#13272)
+
+-------------------------------------------------------------------
+Tue May 20 14:53:51 CEST 2003 - gs@suse.de
+
+- package installation: additional filter view "Installed Packages",
+ installation of source packages (SRPMs), improved dependency popup
+
+-------------------------------------------------------------------
+Wed Apr 30 16:34:59 CEST 2003 - ma@suse.de
+
+- Fixed list indentation in RichText widget (#18204)
+
+-------------------------------------------------------------------
+Tue Mar 11 14:57:32 CET 2003 - gs@suse.de
+
+- V 2.7.13
+- package installation: check dependencies at startup (bug #25011),
+ fixed typo in help text
+
+-------------------------------------------------------------------
+Fri Mar 7 13:02:04 CET 2003 - gs@suse.de
+
+- V 2.7.12
+- package installation: bugfix for not translated messages (#24834),
+ update required diskspace after dependency solving
+
+-------------------------------------------------------------------
+Tue Mar 4 10:22:04 CET 2003 - gs@suse.de
+
+- NCstyle.braille.h added to Makefile.am
+
+-------------------------------------------------------------------
+Mon Mar 3 12:39:50 CET 2003 - gs@suse.de
+
+- V 2.7.11
+- get the floppy device to save/load package selections (bug #23923)
+
+-------------------------------------------------------------------
+Wed Feb 26 15:39:37 CET 2003 - ma@suse.de
+
+- Support unsing a different styleset for Braille-Users. Activated, if
+ environmentvariable Y2_BRAILLE is set.
+
+-------------------------------------------------------------------
+Tue Feb 25 15:23:52 CET 2003 - gs@suse.de
+
+- package installation: restore the package manager state on Cancel,
+ show a warning popup, show file list for installed packages
+
+-------------------------------------------------------------------
+Mon Feb 24 17:54:17 CET 2003 - ma@suse.de
+
+- V 2.7.10
+- Implemented opt(immediate) for SelectionBox. If set together with
+ opt(notify), userInput is triggered on selection bar movement too.
+- Do not trigger UserInput for empty SelectionBox/Table/Tree, if
+ SPACE was pressed. (#24023)
+
+-------------------------------------------------------------------
+Mon Feb 24 17:31:15 CET 2003 - gs@suse.de
+
+- V 2.7.9
+- package installation: save and load package selections (bug #23923)
+
+-------------------------------------------------------------------
+Fri Feb 21 12:04:18 CET 2003 - gs@suse.de
+
+- package installation: display a list containing all packages which
+ will be installed automatically (bug #23770)
+
+-------------------------------------------------------------------
+Thu Feb 20 16:37:13 CET 2003 - gs@suse.de
+
+-- display correct formatted text in notify popups (bug #23868)
+
+-------------------------------------------------------------------
+Tue Feb 18 15:29:46 CET 2003 - gs@suse.de
+
+- draw the progress bar correctly (bug #23189)
+
+-------------------------------------------------------------------
+Tue Feb 18 12:01:17 CET 2003 - ma@suse.de
+
+- Filter character entities in richtext widget (&[amp|gt|lt|nbsp|quot];)
+ (#23721)
+
+-------------------------------------------------------------------
+Mon Feb 17 16:18:20 CET 2003 - gs@suse.de
+
+- V 2.7.8
+- setLanguage: never set encoding to UTF-8 (bug #23348)
+- package installation: show more package info, improved
+ selection popup, show total download size in YOU mode
+
+-------------------------------------------------------------------
+Thu Feb 13 22:46:02 CET 2003 - ma@suse.de
+
+- Let all widgets respond to UI enable/disable requests.
+- Let Frames enable/disable all widgets in it (#22471)
+
+-------------------------------------------------------------------
+Mon Feb 10 15:20:46 CET 2003 - gs@suse.de
+
+- V 2.7.7
+- package installation: allow status "Taboo" for installed packages,
+ provide the save/load settings popup (not yet finished)
+
+-------------------------------------------------------------------
+Fri Jan 31 15:42:54 CET 2003 - gs@suse.de
+
+- V 2.7.6
+- package installation: dependency popup improved (it is possible to
+ ignore dependencies); show used/free/total disk space;
+ show error popup if disk space is exhausted
+
+-------------------------------------------------------------------
+Thu Jan 30 15:24:25 CET 2003 - ma@suse.de
+
+- Widgets beeping on illegal keyboard input (NCIntField|NCTextEntry|NCTextPad)
+ must handle KEY_HOTKEY, otherwise they beep on hotkey activation. (#23198)
+
+-------------------------------------------------------------------
+Mon Jan 27 16:59:37 CET 2003 - gs@suse.de
+
+- V 2.7.5
+- rpm-devel added to neededforbuild
+- package installation: show dependencies between package selections
+
+-------------------------------------------------------------------
+Tue Dec 03 16:36:41 CET 2002 - arvin@suse.de
+
+- added curl-devel and openssl-devel to neededforbuild
+
+-------------------------------------------------------------------
+Fri Nov 29 16:20:29 CET 2002 - gs@suse.de
+
+- V 2.7.3
+- function key handling enabled
+- improvements for package installation dialog
+
+-------------------------------------------------------------------
+Tue Nov 26 15:36:02 CET 2002 - gs@suse.de
+
+- V 2.6.24
+ online update: better format for patch descriptions
+ (preserve newlines)
+
+-------------------------------------------------------------------
+Thu Nov 14 20:56:17 CET 2002 - ma@suse.de
+
+- V 2.7.2
+- Fixed bug that inhibits logging on big-endian architectures.
+
+-------------------------------------------------------------------
+Thu Nov 14 19:34:31 CET 2002 - ma@suse.de
+
+- V 2.6.23
+- Fixed bug that inhibits logging on big-endian architectures.
+
+
+------------------------------------------------------------------
+Wed Nov 13 12:35:21 CET 2002 - gs@suse.de
+
+- V 2.6.22
+- package installation: package categories which will be installed
+ are selected in Filter/Selections menu (bug #21700)
+
+-------------------------------------------------------------------
+Thu Nov 7 13:30:02 CET 2002 - sh@suse.de
+
+- Fixed bug #19389: Frame widget shows keyboard shortcuts, but
+ can't handle any
+
+-------------------------------------------------------------------
+Mon Oct 21 14:49:17 CEST 2002 - gs@suse.de
+
+- V 2.6.21
+- package installation: show correct package dependencies in case of
+ package conflicts (bug #21045/#21061), show the license
+
+-------------------------------------------------------------------
+Wed Oct 9 15:15:49 CEST 2002 - gs@suse.de
+
+- V 2.6.20
+- package installation: show the source of installation in the list
+ of available packages (bug #20734)
+
+-------------------------------------------------------------------
+Wed Sep 18 15:23:08 CEST 2002 - gs@suse.de
+
+- V 2.6.19
+- package installation: update the required disk space info
+ if selections are selected/deselected (bug #19770),
+ show translated summary of installed packages and
+ the selections, toggle the package status with space key,
+ layout of search popup changed (headline was truncated)
+ (bug #19725)
+
+-------------------------------------------------------------------
+Thu Sep 12 13:40:20 CEST 2002 - gs@suse.de
+
+- V 2.6.18
+- package installation: show the delete notify also if a package
+ is deselected or is set to status taboo
+
+-------------------------------------------------------------------
+Tue Sep 10 19:52:13 CEST 2002 - gs@suse.de
+
+- V 2.6.17
+- package installation: bugfix duplicate search results (#19342)
+- YOU: don't check package dependencies
+
+-------------------------------------------------------------------
+Tue Sep 10 16:08:42 CEST 2002 - gs@suse.de
+
+- V 2.6.16
+- package installation: show the required disk space,
+ do an initial dependency solving, allow status change autoinstall -> taboo
+- bugfixes YOU: deselect works, don't check dependencies
+
+-------------------------------------------------------------------
+Mon Sep 9 18:31:47 CEST 2002 - gs@suse.de
+
+- V 2.6.15
+- package installation: improved dependency checking
+
+-------------------------------------------------------------------
+Sun Sep 8 17:36:42 CEST 2002 - gs@suse.de
+
+- V 2.6.14
+- package installation: improved performance for large lists,
+ search ignore case works, search in summary
+
+-------------------------------------------------------------------
+Sat Sep 7 18:37:55 CEST 2002 - gs@suse.de
+
+- V 2.6.13
+- package installation: show a popup during dependency checking,
+- search in package names
+
+-------------------------------------------------------------------
+Fri Sep 6 19:39:58 CEST 2002 - gs@suse.de
+
+- V 2.6.12
+- package installation: dependencies popup improved,
+- show the "update problem" list
+
+-------------------------------------------------------------------
+Thu Sep 5 20:34:24 CEST 2002 - gs@suse.de
+
+- V 2.6.11
+- package installation: show conflict dependencies (still not
+ yet finished)
+
+-------------------------------------------------------------------
+Thu Sep 5 19:08:32 CEST 2002 - gs@suse.de
+
+- V 2.6.10
+- package installation: return `cancel and `accept
+- show the package dependencies (not yet completed)
+- set status to taboo is possible now
+
+-------------------------------------------------------------------
+Tue Sep 3 14:46:43 CEST 2002 - gs@suse.de
+
+- V 2.6.9
+- old behaviour of SelectionBox (notify only on return, space)
+- package installation: status change respects previous status,
+ toggle status enabled
+- online udpate: new layout, correct status change
+
+-------------------------------------------------------------------
+Wed Aug 28 16:24:09 CEST 2002 - gs@suse.de
+
+- V 2.6.8
+- SelectionBox respects `opt(`notify)
+
+-------------------------------------------------------------------
+Tue Aug 27 18:02:46 CEST 2002 - gs@suse.de
+
+- V 2.6.7
+- package installation: show more package information,
+ select/deselect selections
+
+-------------------------------------------------------------------
+Mon Aug 26 17:06:08 CEST 2002 - gs@suse.de
+
+- V 2.6.6
+- package installation: set the package status
+
+-------------------------------------------------------------------
+Sat Aug 24 09:26:58 CEST 2002 - gs@suse.de
+
+- V 2.6.5
+- package installation: get rpm goups and selections,
+ enable YOU mode
+
+-------------------------------------------------------------------
+Wed Aug 21 17:07:51 CEST 2002 - gs@suse.de
+
+- V 2.6.4
+- popup added (beta version), more logging
+
+-------------------------------------------------------------------
+Mon Aug 19 19:06:20 CEST 2002 - sh@suse.de
+
+- V 2.6.3
+- New package management
+
+-------------------------------------------------------------------
+Wed Jul 03 12:26:33 CEST 2002 - msvec@suse.cz
+
+- devel sub-package not neeeded
+
+-------------------------------------------------------------------
+Mon Jun 24 13:41:03 CEST 2002 - arvin@suse.de
+
+- renamed from yast2-ui-ncurses to yast2-ncurses
+
+-------------------------------------------------------------------
+Wed Apr 24 11:25:41 CEST 2002 - arvin@suse.de
+
+- fixed paths for x86-64
+
+-------------------------------------------------------------------
+Fri Mar 22 17:10:36 CET 2002 - kkaempf@suse.de
+
+- pass callback information from component stub to interpreter
+ (#15311).
+
+-------------------------------------------------------------------
+Mon Mar 11 18:56:32 CET 2002 - ma@suse.de
+
+- version to 2.5.14
+- Prevent '<li><p>' from opening a new line. Disable first line
+ indentation for indented paragraphs. (#14816)
+
+-------------------------------------------------------------------
+Fri Mar 8 14:46:55 CET 2002 - ma@suse.de
+
+- version to 2.5.13
+- fixed bad text layout in RichText (#14395)
+- regard libyui hint, and supress screen upadtes while a ReplacePoints
+ content is exchanged.
+
+-------------------------------------------------------------------
+Tue Mar 5 15:58:34 CET 2002 - kkaempf@suse.de
+
+- Better vertical space usage in RichText widget:
+ Suppress implicit <br> after </hX> (end header tag) if
+ <ol> or <ul> (begin list tag) follows, since lists always
+ start on a new line. This makes i.e the package installation
+ widget display the package name and label in 4 lines instead
+ of 6.
+
+-------------------------------------------------------------------
+Tue Mar 5 15:13:47 CET 2002 - kkaempf@suse.de
+
+- Suppress "(none)" as hostname in title bar.
+
+-------------------------------------------------------------------
+Mon Feb 25 16:21:36 CET 2002 - ma@suse.de
+
+- version to 2.5.10
+- show hostname in title line
+
+-------------------------------------------------------------------
+Sun Feb 24 12:52:20 CET 2002 - ma@suse.de
+
+- version to 2.5.9
+- Removed some superflous mention of of default arguments in
+ function definitions. In addition one definition didn't
+ comletely match the declaration. At least gcc3 is so kind to
+ report this incident.
+
+-------------------------------------------------------------------
+Fri Feb 22 12:49:00 CET 2002 - ma@suse.de
+
+- version to 2.5.8
+- Revert behaviour of `opt(`notify). UserInput is triggered iff <SPACE>
+ or <RETURN> ist pressed. There's too much ycp code, that otherwise breaks.
+
+-------------------------------------------------------------------
+Wed Feb 20 20:55:10 CET 2002 - ma@suse.de
+
+- version to 2.5.7
+- Changed `opt(`notify) for Table, Lists and Tree. Should behave
+ more like qt now. UserInput is now triggered not only if you
+ explicitly select an item by pressing <SPACE> or <RETURN>, but
+ also if the highlighted item changes.
+
+-------------------------------------------------------------------
+Wed Feb 20 18:48:38 CET 2002 - ma@suse.de
+
+- version to 2.5.6
+- Fixed screen update. Some widgets changes became not immediatelty
+ visible, if dialog is not waiting for userinput. (#13335)
+
+-------------------------------------------------------------------
+Fri Feb 15 13:36:27 CET 2002 - kkaempf@suse.de
+
+- "utf-8" -> "UTF-8" for iconv (#13276).
+
+-------------------------------------------------------------------
+Thu Feb 14 13:54:40 CET 2002 - schwab@suse.de
+
+- Fix for gcc 3.1.
+- Remove ia64 workaround.
+
+-------------------------------------------------------------------
+Fri Feb 8 17:03:43 CET 2002 - sh@suse.de
+
+- version to 2.5.4
+- added filename constructor to NCImage
+
+-------------------------------------------------------------------
+Thu Feb 7 18:41:08 CET 2002 - ma@suse.de
+
+- version to 2.5.3
+- fixed IntField: Number entry popup popped down too early.
+- fixed CheckBox: Redwaw sometimes left vestiges.
+- removed usage of BLINK attribute, as it realy blinks on some
+ xterm's and normal VGA linux console.
+
+-------------------------------------------------------------------
+Sat Jan 26 17:53:27 CET 2002 - ma@suse.de
+
+- version to 2.5.2
+- libyui now is able to tell that multiple drawing operations will
+ be performed, so we can avoid superfluous screen updates. This
+ speeds up building of large tables, as used in single package
+ selection.
+
+-------------------------------------------------------------------
+Fri Jan 25 00:26:52 CET 2002 - ma@suse.de
+
+- version to 2.5.1
+- fixed `opt(`notify) not working for TextEntry (#12237)
+- fixed Frame widget discarding accelerator. Now a Frame activates
+ the first appropriate child found. (#10458 )
+- new: RichText now supports headlines, ordered and unorderd lists
+ and hyperlinks.
+- (almost) all widget attributes are now managed by NCStyle class.
+ This makes it easier to create introduce new skins.
+
+-------------------------------------------------------------------
+Wed Oct 10 13:54:35 CEST 2001 - ma@suse.de
+
+- version to 2.5.0
+- fix: usage of va_args on ppc caused segmentation fault.
+
+-------------------------------------------------------------------
+Sun Sep 9 13:09:37 CEST 2001 - ma@suse.de
+
+- fix: setFocus reported an error if the widget already has the
+ focus.
+
+-------------------------------------------------------------------
+Fri Sep 7 16:04:52 CEST 2001 - ma@suse.de
+
+- version to 2.4.5
+- UI-specific getDisplayInfo() functions added
+
+-------------------------------------------------------------------
+Tue Aug 21 10:25:45 CEST 2001 - ma@suse.de
+
+- fixes to compile with gcc 3.0
+
+-------------------------------------------------------------------
+Fri Aug 17 10:18:27 CEST 2001 - ma@suse.de
+
+- version to 2.4.4
+- new: Hotkeys and BackTab (<ESC-key>/<ESC-TAB>) (#8448)
+- new: May restrict input characters in TextEntry (#8357)
+- new: MenuButton widgets
+- fix: Comobox didn't send notify
+- fix: Unused special keys (e.g. FKeys,Cursor) in MultiLineEdit
+ produced garbage input.
+- changed: No more auto disabling of nonscrollable (text fits in
+ widget) RichText and LogView. Next step will be to provide zoom
+ and collapse function.
+- changed: Navigation in Tree. Curs-Left/Right either collapse/expand
+ current entry if possible or move to previous/next item otherwise.
+ Not both in on step.
+
+-------------------------------------------------------------------
+Wed Jul 11 16:12:35 CEST 2001 - ma@suse.de
+
+- version to 2.4.3
+- fixed setConsoleFont(). 'setfont' and 'magic char echo' now
+ explicitly use the same tty ncurses opened at startup.
+
+-------------------------------------------------------------------
+Tue Jul 10 20:09:18 CEST 2001 - ma@suse.de
+
+- version to 2.4.2
+- new widget: MultiSelectionBox
+- fixes in font switching
+
+-------------------------------------------------------------------
+Tue Jun 19 15:11:58 CEST 2001 - kkaempf@suse.de
+
+- implement callback mechanism
+- version 2.4.1
+
+-------------------------------------------------------------------
+Fri May 11 23:52:44 CEST 2001 - kendy@suse.cz
+
+- version 2.3.12
+- fixed switching of fonts: czech language was unreadable
+ (not reported bug)
+
+-------------------------------------------------------------------
+Fri May 11 17:43:08 CEST 2001 - kkaempf@suse.de
+
+- version to 2.3.11
+- add split-alias entries to specfile (#8133)
+
+-------------------------------------------------------------------
+Fri May 11 09:30:03 CEST 2001 - ma@suse.de
+
+- version to 2.3.10
+- fixed: ComboBox now shows 1st entry if no default provided (#8072)
+- fixed: TextEntry en/disabling was unfunctional (#8072)
+
+-------------------------------------------------------------------
+Mon Apr 30 16:14:48 CEST 2001 - kkaempf@suse.de
+
+- only -devel provides y2curses
+
+-------------------------------------------------------------------
+Mon Apr 30 16:12:42 CEST 2001 - ma@suse.de
+
+- let yast2-ui-ncurses provide 'YaST2-UI'
+
+-------------------------------------------------------------------
+Mon Apr 30 15:59:14 CEST 2001 - ma@suse.de
+
+- version to 2.3.8
+- log tty detection in ncurses init as milestone
+
+-------------------------------------------------------------------
+Wed Apr 25 16:32:28 CEST 2001 - ma@suse.de
+
+- don't return an error if setfont fails, as the calling libyui
+ function isn't able to make anything usefull out of it.
+
+-------------------------------------------------------------------
+Tue Apr 17 15:00:06 CEST 2001 - ma@suse.de
+
+- version to 2.3.7
+- new color scheme.
+
+-------------------------------------------------------------------
+Wed Apr 11 12:29:52 CEST 2001 - schwab@suse.de
+
+- Fix ambiguous call to string::insert.
+
+-------------------------------------------------------------------
+Wed Apr 4 15:23:36 CEST 2001 - ma@suse.de
+
+- version to 2.3.6
+- fixed tree widget to expand/hide subtrees
+- fixed richtext widget to recognize html tags with arguments and
+ handle ' '
+
+-------------------------------------------------------------------
+Fri Mar 30 09:02:18 CEST 2001 - kkaempf@suse.de
+
+- dont install lib, only plugin is needed
+
+-------------------------------------------------------------------
+Mon Mar 26 11:52:04 CEST 2001 - ma@suse.de
+
+- added missing 'const' in previous fix
+
+-------------------------------------------------------------------
+Fri Mar 23 14:38:01 CET 2001 - ma@suse.de
+
+- version to 2.3.5
+- fixed dirty hack in NCurses.cc, using NCursesPanel's private
+ 'typedef struct UserHook;'.
+
+-------------------------------------------------------------------
+Thu Mar 22 18:31:57 CET 2001 - ma@suse.de
+
+- version to 2.3.4
+- allow multiline labeltexts for RadioButton and PushButton (#6711)
+- let ComboBox's list popup appear below value field (not centered
+ on screen)
+- provide a TextEntry popup in IntField, to manually enter a value
+
+-------------------------------------------------------------------
+Mon Mar 12 13:17:03 CET 2001 - arvin@suse.de
+
+- version to 2.3.3
+- Strip plugin in package.
+
+-------------------------------------------------------------------
+Thu Mar 8 17:33:47 CET 2001 - ma@suse.de
+
+- package name changed from y2curses(old) to yast2-ui-ncurses(new).
+
+-------------------------------------------------------------------
+Fri Feb 23 17:37:52 CET 2001 - ma@suse.de
+
+- setLanguage now sets a proper defaultEncoding. At startup the
+ defaultEncoding is set according to ${LANG}.
+- The default 'language to encoding' mapping is stored in the
+ script 'lang2encoding.tab' which generates 'lang2encoding.cc'.
+- Evaluation of ${Y2NCURSES_ENCODING} has been removed.
+
+-------------------------------------------------------------------
+Fri Feb 23 13:53:32 CET 2001 - ma@suse.de
+
+- version to 2.3.2
+- moved class NCstring back from libyui.
+
+-------------------------------------------------------------------
+Thu Feb 22 10:32:41 CET 2001 - ma@suse.de
+
+- initiate NCurses::Redraw for _all_ visible dialogs on encoding
+ change.
+- Y2NCursesUI constructor will set the defaultEncoding to the value
+ of Y2NCURSES_ENCODING environment variable, if present. Might be
+ helpfull for testing until some other y2 part sets the encoding
+ according to the LANG variable.
+
+-------------------------------------------------------------------
+Wed Feb 21 15:55:33 CET 2001 - ma@suse.de
+
+- version to 2.3.1
+- adjustments to new libyui(NCstring) interface
+- various changes to get a correct screen after font/encoding
+ has been changed.
+
+-------------------------------------------------------------------
+Sat Jan 27 21:20:12 CET 2001 - arvin@suse.de
+
+- package split y2curses / y2curses-devel
+
+-------------------------------------------------------------------
+Sat Jan 20 15:47:59 CET 2001 - arvin@suse.de
+
+- version to 2.2.19
+- make package compile
+
+-------------------------------------------------------------------
+Fri Jan 19 17:30:52 CET 2001 - ma@suse.de
+
+- version to 2.2.18
+- Pass encoding as argument to NCstring::setDefaultEncoding()
+
+-------------------------------------------------------------------
+Thu Jan 18 18:39:16 CET 2001 - sh@suse.de
+
+- version to 2.2.17
+- added new parameter "encoding" to setConsoleFont()
+
+-------------------------------------------------------------------
+Mon Jan 15 11:04:10 CET 2001 - ma@suse.de
+
+- version to 2.2.16
+- fixed IntField not responding to opt(notify) (#5636, no volume control
+ in sound configuration due to missing callback)
+- map UI-specific redrawScreen() to NCurses::Refresh()
+
+-------------------------------------------------------------------
+Thu Jan 11 20:21:10 CET 2001 - ma@suse.de
+
+- version to 2.2.15
+- fixed attribute set for BW mode (list and table selection were
+ not visible) (#3756)
+
+-------------------------------------------------------------------
+Thu Jan 11 14:45:55 CET 2001 - ma@suse.de
+
+- version to 2.2.14
+- Do screen refresh on <Ctrl-L> to get rid of any messages that
+ might have been writen to the console (e.g. network shutdown)
+
+-------------------------------------------------------------------
+Fri Jan 5 15:58:26 CET 2001 - ma@suse.de
+
+- version to 2.2.13
+- fixed missing caption in empty tables (#5192)
+
+-------------------------------------------------------------------
+Thu Jan 4 16:42:24 CET 2001 - ma@suse.de
+
+- version to 2.2.12
+- fixed incorrect display of 8bit chars in RichText widgets (#4967)
+
+-------------------------------------------------------------------
+Thu Jan 4 10:53:15 CET 2001 - kkaempf@suse.de
+
+- version to 2.2.11
+ move NCstring to libyui
+
+-------------------------------------------------------------------
+Thu Jan 2 14:27:39 CET 2001 - ma@suse.de
+
+- fixed: whole passwd field filled with '*' (#5107)
+
+-------------------------------------------------------------------
+Fri Dec 22 18:25:22 CET 2000 - ma@suse.de
+
+- version to 2.2.10
+- new MultiLineEdit widget
+
+-------------------------------------------------------------------
+Wed Dec 20 14:16:15 CET 2000 - ma@suse.de
+
+- version to 2.2.9
+- new LogView widget
+
+-------------------------------------------------------------------
+Tue Dec 19 18:29:57 CET 2000 - ma@suse.de
+
+- version to 2.2.8
+- basic Tree (always expanded)
+
+-------------------------------------------------------------------
+Tue Dec 19 15:18:37 CET 2000 - ma@suse.de
+
+- version to 2.2.7
+- pass YCPstrings to ui specific widgets
+
+-------------------------------------------------------------------
+Mon Dec 18 16:59:30 CET 2000 - ma@suse.de
+
+- version to 2.2.6
+- some more missing recodes fixed.
+- changed behaviour of NCDialog if UI requests input from a dialog
+ with no active items. Previous version missed to look for a widget
+ that might have been enabeled since the last request, and thus may
+ be activated now. If there's still no active widget, the request is
+ ignored on pollInput() and idleLoop(). Previous version sent ET_CANCEL,
+ causing the dialog to be closed.
+
+-------------------------------------------------------------------
+Thu Dec 14 17:22:30 CET 2000 - ma@suse.de
+
+- version to 2.2.5
+- fixed Table to show column separator and headline
+- force recoding of utf8 strings where YUI provides them as
+ 'class string' (only YCPString is recoded automaticaly).
+- separated table items and style from TablePad structure.
+
+-------------------------------------------------------------------
+Wed Dec 13 11:48:09 CET 2000 - ma@suse.de
+
+- version to 2.2.4
+- new NCPadWidget as base for all scrollable widgets.
+- new NCPad's for plain and list style
+
+-------------------------------------------------------------------
+Wed Dec 6 11:15:05 CET 2000 - ma@suse.de
+
+- version to 2.2.3
+- provide ComboBox widget
+- fix TextEntry (didn't scroll on long texts)
+- fix RichText (avoid hscroll, support bold/it/tt and simple list)
+- code, layout and debug stuff cleanup
+- dummy Tree and LogView widgets
+
+-------------------------------------------------------------------
+Tue Nov 28 17:20:48 CET 2000 - arvin@suse.de
+
+- version to 2.2.2
+- plugin is linked against libncurses and libpanel.
+
+-------------------------------------------------------------------
+Thu Nov 16 17:52:36 CET 2000 - ma@suse.de
+
+- version to 2.2.1
+- provide IntField widget
+
+-------------------------------------------------------------------
+Thu Nov 16 17:12:39 CET 2000 - kkaempf@suse.de
+
+- split library and plugin
+
+-------------------------------------------------------------------
+Wed Nov 8 12:38:48 CET 2000 - kkaempf@suse.de
+
+- link with libutil and libcrypt
+
+-------------------------------------------------------------------
+Wed Oct 25 18:41:26 CEST 2000 - kkaempf@suse.de
+
+- provide lib and plugin
+
+-------------------------------------------------------------------
+Wed Oct 25 18:29:03 CEST 2000 - kkaempf@suse.de
+
+- Group set
+
+-------------------------------------------------------------------
+Wed Oct 25 13:07:36 CEST 2000 - kkaempf@suse.de
+
+- updated version, prepared for new libyui interface
+ version 2.1.1
+
+-------------------------------------------------------------------
+Mon Jul 24 18:05:10 CEST 2000 - ma@suse.de
+
+- version to 2.0.8
+- workaround another librecode memory leak (#3589)
+
+-------------------------------------------------------------------
+Thu Jul 20 14:06:29 CEST 2000 - ma@suse.de
+
+- version to 2.0.7
+- fixed broken enable/disable items (#3550)
+
+-------------------------------------------------------------------
+Mon Jul 17 20:24:32 CEST 2000 - ma@suse.de
+
+- version to 2.0.6
+- fixed `opt(`default) for Pushbuttons (#3071)
+
+-------------------------------------------------------------------
+Fri Jul 14 18:35:37 CEST 2000 - ma@suse.de
+
+- version to 2.0.5
+- replaced dummy ComboBox by copy of TextEntry widget.
+- hotkey indicator stripped from widget labels (#3511)
+
+-------------------------------------------------------------------
+Fri Jul 14 10:36:28 CEST 2000 - ma@suse.de
+
+- version to 2.0.4
+- always(!) limit dialog size by screen size. There was one
+ case missing, causing eg. package descriptions to abort because
+ too large dialog sizes were requested (#3136)
+
+-------------------------------------------------------------------
+Thu Jul 13 14:26:09 CEST 2000 - ma@suse.de
+
+- version to 2.0.3
+- redraw screen immediately after any setfont request (#3220)
+
+-------------------------------------------------------------------
+Wed Jul 12 18:37:59 CEST 2000 - ma@suse.de
+
+- version to 2.0.2
+- missing frames and frame labes added (#3133)
+
+-------------------------------------------------------------------
+Mon Jun 19 17:30:14 CEST 2000 - schwab@suse.de
+
+- Add %suse_update_config.
+- Lower opt level on ia64.
+
+-------------------------------------------------------------------
+Mon Jun 5 11:00:18 CEST 2000 - kkaempf@suse.de
+
+- fix include path
+
+-------------------------------------------------------------------
+Thu May 18 12:19:30 CEST 2000 - kkaempf@suse.de
+
+- install in plugin
+ interface change for tree widget
+ bump version to 2.0.1
+
+-------------------------------------------------------------------
+Wed Apr 26 16:25:39 CEST 2000 - kkaempf@suse.de
+
+- Initial version based on yast2 from SuSE 6.4
+
Added: branches/tmp/bubli/ncurses-pkg/src/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/.cvsignore?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/src/.cvsignore (added)
+++ branches/tmp/bubli/ncurses-pkg/src/.cvsignore Fri Feb 8 13:59:32 2008
@@ -0,0 +1,17 @@
+Makefile
+Makefile.in
+ncurses
+widgetlist
+core
+bak
+*.swp
+*.o
+*.lo
+*.loT
+*.la
+.deps
+.libs
+*.kdoc
+SETUPENV.sh
+gsrc
+obsolete
Added: branches/tmp/bubli/ncurses-pkg/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/Makefile.am?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/src/Makefile.am (added)
+++ branches/tmp/bubli/ncurses-pkg/src/Makefile.am Fri Feb 8 13:59:32 2008
@@ -0,0 +1,57 @@
+#
+# Makefile.am for ncurses/src/pkg
+#
+
+ydata_DATA = pkg_layout.ycp \
+ you_layout.ycp
+
+AM_CXXFLAGS = -DY2LOG=\"ui-ncurses\" -DLOCALEDIR=\"${localedir}\"
+
+# plugin, libtool forces 'lib' prefix
+# plugin_LTLIBRARIES = libpy2ncurses_pkg.la
+plugin_LTLIBRARIES = libpy2ncurses_pkg.la
+libpy2ncurses_pkg_la_LDFLAGS = -version-info 2:0
+
+libpy2ncurses_pkg_la_LIBADD = \
+ -L$(plugindir) -lpy2UI \
+ ${ZYPP_LIBS}
+
+noinst_HEADERS = \
+ NCPkgTable.h \
+ NCPackageSelectorStart.h \
+ NCPackageSelectorPluginImpl.h \
+ NCPackageSelector.h \
+ NCPkgSelMapper.h \
+ NCPkgStatusStrategy.h \
+ NCPkgPopupDeps.h \
+ NCPkgPopupDiskspace.h \
+ NCPkgPopupDescr.h \
+ NCPkgPopupTable.h \
+ NCPkgPopupRepo.h \
+ NCPkgPopupSearch.h \
+ NCPkgPopupSelection.h \
+ NCPkgPopupTree.h \
+ NCPkgNames.h \
+ NCZypp.h
+
+libpy2ncurses_pkg_la_SOURCES = \
+ NCPkgTable.cc \
+ NCPackageSelectorStart.cc \
+ NCPackageSelectorPluginImpl.cc \
+ NCPackageSelector.cc \
+ NCPkgSelMapper.cc \
+ NCPkgStatusStrategy.cc \
+ NCPkgPopupDeps.cc \
+ NCPkgPopupDiskspace.cc \
+ NCPkgPopupDescr.cc \
+ NCPkgPopupTable.cc \
+ NCPkgPopupRepo.cc \
+ NCPkgPopupSearch.cc \
+ NCPkgPopupSelection.cc \
+ NCPkgPopupTree.cc \
+ NCPkgNames.cc
+
+
+INCLUDES = -I$(includedir) -I$(includedir)/yui -I$(includedir)/ncurses ${ZYPP_CFLAGS}
+
+EXTRA_DIST = $(ydata_DATA)
Added: branches/tmp/bubli/ncurses-pkg/src/NCPackageSelector.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/NCPackageSelector.cc?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/src/NCPackageSelector.cc (added)
+++ branches/tmp/bubli/ncurses-pkg/src/NCPackageSelector.cc Fri Feb 8 13:59:32 2008
@@ -0,0 +1,3484 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: NCPackageSelector.cc
+
+ Author: Gabriele Strattner
+ Maintainer: Michael Andres
+
+/-*/
+#include "NCurses.h"
+#include "NCWidgetFactory.h"
+#include "NCPushButton.h"
+#include "NCMenuButton.h"
+#include "NCTable.h"
+#include "NCPkgTable.h"
+#include "NCSpacing.h"
+#include "NCRichText.h"
+#include "NCLabel.h"
+#include "NCPkgPopupSearch.h"
+#include "NCPopupInfo.h"
+#include "NCSelectionBox.h"
+#include "NCMenuButton.h"
+#include "NCPkgPopupSelection.h"
+#include "NCPkgPopupRepo.h"
+#include "NCPkgPopupDeps.h"
+#include "NCPkgPopupDiskspace.h"
+#include "NCPkgPopupTable.h"
+#include "NCPkgPopupDescr.h"
+#include "NCPackageSelector.h"
+#include "NCLayoutBox.h"
+#include "YSelectionBox.h"
+#include "YAlignment.h"
+#include "YNCursesUI.h"
+#include "YApplication.h"
+#include "NCi18n.h"
+
+#include
+#include <fstream>
+#include <iomanip>
+#include <list>
+#include <string>
+#include <set>
+
+#include "NCZypp.h" // tryCastToZyppPkg(), tryCastToZyppPatch()
+#include
+#include
+#include
+
+#include "YWidgetID.h"
+#include "YCPDialogParser.h"
+#include "YCPMenuItem.h"
+#include "YCPValueWidgetID.h"
+#include "YPackageSelector.h"
+
+typedef zypp::ui::PatchContents ZyppPatchContents;
+typedef zypp::ui::PatchContents::const_iterator ZyppPatchContentsIterator;
+typedef zypp::syscontent::Reader::Entry ZyppReaderEntry;
+typedef std::pair importMapPair;
+
+#include
+#include
+#include
+#include "YEvent.h"
+
+#define DEFAULT_EXPORT_FILE_NAME "user-packages.xml"
+
+using namespace std;
+using std::string;
+using std::wstring;
+using std::map;
+using std::pair;
+
+/*
+ Textdomain "packages"
+*/
+
+///////////////////////////////////////////////////////////////////
+//
+// CompFunc
+//
+bool sortByName( ZyppSel ptr1, ZyppSel ptr2 )
+{
+ if ( ptr1->name() < ptr2->name() )
+ {
+ return true;
+ }
+ return false;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// ignore case compare
+//
+bool ic_compare ( char c1, char c2 )
+{
+ return ( toupper( c1 ) == toupper( c2 ) );
+}
+
+
+///////////////////////////////////////////////////////////////////
+//
+// Constructor
+//
+NCPackageSelector::NCPackageSelector( YNCursesUI * ui, YWidget * wRoot, long modeFlags )
+ : y2ui( ui )
+ , widgetRoot ( wRoot )
+ , filterPopup( 0 )
+ , depsPopup( 0 )
+ , selectionPopup( 0 )
+ , patternPopup( 0 )
+ , languagePopup( 0 )
+ , repoPopup( 0 )
+ , diskspacePopup( 0 )
+ , searchPopup( 0 )
+ , youMode( false )
+ , updateMode( false )
+ , testMode ( false )
+ , autoCheck( true )
+ , _rpmGroupsTree (0)
+ , pkgList ( 0 )
+ , filterMenu( 0 )
+ , groupsItem( 0 )
+ , patternsItem( 0 )
+ , languagesItem( 0 )
+ , reposItem( 0 )
+ , searchItem( 0 )
+ , installedItem( 0 )
+ , whatifItem( 0 )
+ , updatelistItem( 0 )
+ , actionMenu( 0 )
+ , toggleItem( 0 )
+ , selectItem( 0 )
+ , deleteItem( 0 )
+ , updateItem( 0 )
+ , tabooItem( 0 )
+ , notabooItem( 0 )
+ , allItem( 0 )
+ , selallItem( 0 )
+ , delallItem( 0 )
+ , deselallItem( 0 )
+ , dontdelItem( 0 )
+ , updnewerItem( 0 )
+ , updallItem( 0 )
+ , dontupdItem( 0 )
+ , infoMenu( 0 )
+ , pkginfoItem( 0 )
+ , longdescrItem( 0 )
+ , versionsItem( 0 )
+ , filesItem( 0 )
+ , relationsItem( 0 )
+ , patchdescrItem( 0 )
+ , patchpkgsItem( 0 )
+ , pkgversionsItem( 0 )
+ , etcMenu( 0 )
+ , depsItem( 0 )
+ , showdepsItem( 0 )
+ , autodepsItem( 0 )
+ , noautodepsItem( 0 )
+ , verifyItem( 0 )
+ , allpksItem( 0 )
+ , exportItem( 0 )
+ , importItem( 0 )
+ , testcaseItem( 0 )
+ , filterLabel( 0 )
+ , diskspaceLabel( 0 )
+ , infoText( 0 )
+ , replacePoint( 0 )
+ , versionsList( 0 )
+ , patchPkgs( 0 )
+ , patchPkgsVersions( 0 )
+ , okButton( 0 )
+ , cancelButton( 0 )
+ , visibleInfo( 0 )
+
+{
+ // FIXME - remove this code when everthiong is handled by handleEvent() !
+ // (the eventHandlerMap is obsolete)
+
+ // Fill the handler map
+ eventHandlerMap[ NCPkgNames::Search()->toString() ] = &NCPackageSelector::SearchHandler;
+ eventHandlerMap[ NCPkgNames::Diskinfo()->toString() ] = &NCPackageSelector::DiskinfoHandler;
+
+ // Filter - add selectionsItem, if really needed
+ // eventHandlerMap[ NCPkgNames::Selections()->toString() ] = &NCPackageSelector::FilterHandler;
+
+ // YOU filter
+ eventHandlerMap[ NCPkgNames::Recommended()->toString() ] = &NCPackageSelector::FilterHandler;
+ eventHandlerMap[ NCPkgNames::Security()->toString() ] = &NCPackageSelector::FilterHandler;
+ eventHandlerMap[ NCPkgNames::Optional()->toString() ] = &NCPackageSelector::FilterHandler;
+ eventHandlerMap[ NCPkgNames::InstalledPatches()->toString() ] = &NCPackageSelector::FilterHandler;
+ eventHandlerMap[ NCPkgNames::AllPatches()->toString() ] = &NCPackageSelector::FilterHandler;
+ eventHandlerMap[ NCPkgNames::NewPatches()->toString() ] = &NCPackageSelector::FilterHandler;
+ eventHandlerMap[ NCPkgNames::InstalledPatches()->toString() ] = &NCPackageSelector::FilterHandler;
+ eventHandlerMap[ NCPkgNames::InstallablePatches()->toString() ] = &NCPackageSelector::FilterHandler;
+ eventHandlerMap[ NCPkgNames::YaST2Patches()->toString() ] = &NCPackageSelector::FilterHandler;
+
+ // Information menu -> DONE
+
+ // Action menu -> DONE
+
+ // Etc. menu -> DONE
+
+ // Help menu
+ eventHandlerMap[ NCPkgNames::GeneralHelp()->toString() ] = &NCPackageSelector::HelpHandler;
+ eventHandlerMap[ NCPkgNames::StatusHelp()->toString() ] = &NCPackageSelector::HelpHandler;
+ eventHandlerMap[ NCPkgNames::FilterHelp()->toString() ] = &NCPackageSelector::HelpHandler;
+ eventHandlerMap[ NCPkgNames::UpdateHelp()->toString() ] = &NCPackageSelector::HelpHandler;
+ eventHandlerMap[ NCPkgNames::SearchHelp()->toString() ] = &NCPackageSelector::HelpHandler;
+ eventHandlerMap[ NCPkgNames::PatchHelp()->toString() ] = &NCPackageSelector::YouHelpHandler;
+
+
+ if ( modeFlags & YPkg_OnlineUpdateMode )
+ youMode = true;
+
+ if ( modeFlags & YPkg_UpdateMode )
+ updateMode = true;
+
+ // read test source information
+ if (modeFlags & YPkg_TestMode )
+ testMode = true;
+
+ saveState ();
+
+ _rpmGroupsTree = new YRpmGroupsTree ();
+
+ // get the rpm groups
+ ZyppPoolIterator b = zyppPkgBegin ();
+ ZyppPoolIterator e = zyppPkgEnd ();
+ ZyppPoolIterator i;
+
+ for ( i = b; i != e; ++i )
+ {
+ ZyppPkg zyppPkg = tryCastToZyppPkg( (*i)->theObj() );
+ if ( zyppPkg )
+ {
+ _rpmGroupsTree->addRpmGroup (zyppPkg->group ());
+ NCDBG << "Adding group: " << zyppPkg->group() << endl;
+ }
+ }
+
+ // The creation of the popups is moved to createPopups()
+}
+
+
+///////////////////////////////////////////////////////////////////
+//
+// Destructor
+//
+NCPackageSelector::~NCPackageSelector()
+{
+ // Changed because of new libyui: don't call delete for the popups;
+ // call YDialog::deleteTopmostDialog() instead at the end of
+ // NCPackageSelectorPlugin::runPkgSelection
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// createPopups()
+//
+// Create all popups
+//
+// Don't create the popups any longer in constructur because the current dialog
+// wouldn't be the PackageSelector dialog then but a PopupDialog and
+// NCPackageSelectorPlugin::runPkgSelection wouldn't find the selector widget.
+// Call NCPackageSelector::createPopups() instead after the PackageSelector dialog
+// is created (see NCPackageSelectorStart::showDefaultList()).
+//
+void NCPackageSelector::createPopups()
+{
+ if ( !youMode )
+ {
+ // create the selections popup
+ selectionPopup = new NCPkgPopupSelection( wpos( 1, 1 ), this, NCPkgPopupSelection::S_Selection );
+
+ // create the patterns popup
+ patternPopup = new NCPkgPopupSelection( wpos( 1, 1 ), this, NCPkgPopupSelection::S_Pattern );
+
+ // create language popup
+ languagePopup = new NCPkgPopupSelection( wpos( 1,1 ), this, NCPkgPopupSelection::S_Language );
+
+ // create repository popup
+ repoPopup = new NCPkgPopupRepo( wpos( 1,1), this );
+
+ // create the filter popup
+ filterPopup = new NCPkgPopupTree( wpos( 1, 1 ), this );
+ }
+
+ // create the search popup
+ searchPopup = new NCPkgPopupSearch( wpos( 1, 1 ), this );
+
+ // the dependency popup
+ depsPopup = new NCPkgPopupDeps( wpos( 3, 8 ), this );
+
+ // the disk space popup
+ diskspacePopup = new NCPkgPopupDiskspace( wpos( (NCurses::lines() - 15)/2, NCurses::cols()/6 ), testMode );
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// getDefaultRpmGroup()
+//
+// returns the default RPM group, the packages of this group
+// are displayed on PackageSelector start
+//
+YStringTreeItem * NCPackageSelector::getDefaultRpmGroup()
+{
+ if ( _rpmGroupsTree &&
+ _rpmGroupsTree->root() )
+ return _rpmGroupsTree->root()->firstChild();
+ else
+ return 0;
+}
+
+void NCPackageSelector::createFilterMenu()
+{
+ bool selections;
+ bool patterns;
+
+ // create the pattern popup
+ if ( ! zyppPool().emptyzypp::Pattern() )
+ {
+
+ patterns = true;
+ }
+ else
+ {
+ patterns = false;
+ }
+ // create the selections popup
+ if ( ! zyppPool().emptyzypp::Selection() )
+ {
+
+ selections = true;
+ }
+ else
+ {
+ selections = false;
+ }
+
+ if ( selections && !patterns )
+ {
+ // ReplaceWidget and show menu entry Selections instead of Patterns
+ char menu[4000];
+ snprintf ( menu, sizeof(menu) - 1,
+ "`MenuButton( `opt(`key_F4), \"%s\", "
+ "[`item( `id(\"groups\"), \"%s\" ), `item( `id(\"selections\"), \"%s\" ), "
+ " `item( `id(\"search\"), \"%s\" ), `item( `id(\"installed\"), \"%s\" ), "
+ " `item( `id(\"whatif\"), \"%s\" ), `item( `id(\"updatelist\"), \"%s\" ) ] ) ",
+ NCPkgNames::MenuFilter().c_str(),
+ NCPkgNames::MenuEntryRPMGroups().c_str(),
+ NCPkgNames::MenuEntrySelections().c_str(),
+ NCPkgNames::MenuEntrySearch().c_str(),
+ NCPkgNames::MenuEntryInstPkg().c_str() ,
+ NCPkgNames::MenuEntryInstSummary().c_str(),
+ NCPkgNames::MenuEntryUpdateList().c_str()
+ );
+
+ Parser parser( menu );
+ YCodePtr parsed_code = parser.parse ();
+ YCPValue layout = YCPNull ();
+ if (parsed_code != NULL)
+ layout = parsed_code->evaluate();
+ if ( !layout.isNull() )
+ y2ui->evaluateReplaceWidget( YCPSymbol("replacefilter"), layout->asTerm() );
+
+ }
+ else if ( patterns && selections )
+ {
+ // ReplaceWidget and show menu entries Patterns AND Selections
+ char menu[4000];
+ snprintf ( menu, sizeof(menu) - 1,
+ "`MenuButton(`opt(`key_F4), \"%s\", "
+ "[`item( `id(\"groups\"), \"%s\" ), `item( `id(\"patterns\"), \"%s\" ), "
+ " `item( `id(\"selections\"), \"%s\" ), "
+ " `item( `id(\"search\"), \"%s\" ), `item( `id(\"installed\"), \"%s\" ), "
+ " `item( `id(\"whatif\"), \"%s\" ), `item( `id(\"updatelist\"), \"%s\" ) ] ) ",
+ NCPkgNames::MenuFilter().c_str(),
+ NCPkgNames::MenuEntryRPMGroups().c_str(),
+ NCPkgNames::MenuEntryPatterns().c_str(),
+ NCPkgNames::MenuEntrySelections().c_str(),
+ NCPkgNames::MenuEntrySearch().c_str(),
+ NCPkgNames::MenuEntryInstPkg().c_str() ,
+ NCPkgNames::MenuEntryInstSummary().c_str(),
+ NCPkgNames::MenuEntryUpdateList().c_str()
+ );
+
+ Parser parser( menu );
+ YCodePtr parsed_code = parser.parse ();
+ YCPValue layout = YCPNull ();
+ if (parsed_code != NULL)
+ layout = parsed_code->evaluate();
+ if ( !layout.isNull() )
+ y2ui->evaluateReplaceWidget( YCPSymbol("replacefilter"), layout->asTerm() );
+
+ }
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// detection whether the user has made any changes
+//
+
+void NCPackageSelector::saveState ()
+{
+ ZyppPool p = zyppPool ();
+
+ p.saveStatezypp::Package ();
+ p.saveStatezypp::SrcPackage ();
+
+ p.saveStatezypp::Patch ();
+ // some future proofing
+ p.saveStatezypp::Message ();
+ p.saveStatezypp::Script ();
+
+ p.saveStatezypp::Selection ();
+ p.saveStatezypp::Pattern ();
+ p.saveStatezypp::Language ();
+}
+
+void NCPackageSelector::restoreState ()
+{
+ ZyppPool p = zyppPool ();
+
+ p.restoreStatezypp::Package ();
+ p.restoreStatezypp::SrcPackage ();
+
+ p.restoreStatezypp::Patch ();
+ // some future proofing
+ p.restoreStatezypp::Message ();
+ p.restoreStatezypp::Script ();
+
+ p.restoreStatezypp::Selection ();
+ p.restoreStatezypp::Pattern ();
+ p.restoreStatezypp::Language ();
+}
+
+bool NCPackageSelector::diffState ()
+{
+ ZyppPool p = zyppPool ();
+
+ bool diff = false;
+
+ ostream & log = UIMIL;
+ log << "diffState" << endl;
+ diff = diff || p.diffStatezypp::Package ();
+ log << diff << endl;
+ diff = diff || p.diffStatezypp::SrcPackage ();
+ log << diff << endl;
+
+ diff = diff || p.diffStatezypp::Patch ();
+ log << diff << endl;
+ // some future proofing
+ diff = diff || p.diffStatezypp::Message ();
+ log << diff << endl;
+ diff = diff || p.diffStatezypp::Script ();
+ log << diff << endl;
+
+ diff = diff || p.diffStatezypp::Selection ();
+ log << diff << endl;
+ diff = diff || p.diffStatezypp::Pattern ();
+ log << diff << endl;
+ diff = diff || p.diffStatezypp::Language ();
+ log << diff << endl;
+ return diff;
+}
+
+string NCPackageSelector::getButtonId( YWidget * button )
+{
+ YCPValueWidgetID * ycpId;
+ string id;
+
+ if ( !button )
+ return id;
+
+ YWidgetID * widgetId = button->id();
+ if ( widgetId )
+ {
+ ycpId = dynamic_cast(widgetId);
+ if ( ycpId )
+ {
+ id = ycpId->toString();
+ }
+ }
+ return id;
+}
+
+string NCPackageSelector::getMenuId( YMenuItem *menuItem )
+{
+ if ( menuItem )
+ {
+ YCPMenuItem * ycpMenuItem = dynamic_cast ( menuItem );
+
+ if ( ycpMenuItem )
+ return ycpMenuItem->id()->toString();
+ }
+
+ return "";
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// handleEvent
+//
+// Handle event, calls corresponding handler-function
+//
+bool NCPackageSelector::handleEvent ( const NCursesEvent& event )
+{
+ bool retVal = false;
+
+ if ( event == NCursesEvent::handled )
+ return false;
+
+ // Call the appropriate handler
+ if ( event == NCursesEvent::button )
+ {
+ if ( event.widget == okButton )
+ retVal = OkButtonHandler( event );
+ else if ( event.widget == cancelButton )
+ retVal = CancelHandler( event );
+
+ }
+ else if ( event == NCursesEvent::menu )
+ {
+ if ( event.widget == filterMenu )
+ // filter out packages/patches
+ retVal = FilterHandler( event );
+ else if ( event.widget == actionMenu )
+ // change package/patch status
+ retVal = StatusHandler( event );
+ else if ( event.widget == infoMenu )
+ // show package/patch information
+ retVal = InformationHandler( event );
+ else if ( event.widget == etcMenu )
+ {
+ if ( event.selection == testcaseItem )
+ // generate testcase
+ retVal = TestcaseHandler( event );
+ else if ( (event.selection == exportItem) || (event.selection == importItem) )
+ // import/export file list
+ retVal = FileHandler( event );
+ else
+ // check package dependencies
+ retVal = DependencyHandler( event );
+ }
+ else if ( event.selection->label().substr(0,4) == "pkg:" )
+ // handle hyper links
+ retVal = LinkHandler( event.selection->label() );
+
+ }
+
+ return retVal;
+}
+
+
+///////////////////////////////////////////////////////////////////
+//
+// setVisibleInfo
+//
+// currently displayed package information
+//
+void NCPackageSelector::setVisibleInfo( YMenuItem * info )
+{
+ visibleInfo = info;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// fillAvailableList
+//
+// Fills the package table (on bottom ) with the list of available packages
+//
+bool NCPackageSelector::fillAvailableList( NCPkgTable * pkgTable, ZyppSel selectable )
+{
+ bool addInstalled = true;
+
+ if ( !pkgTable )
+ {
+ NCERR << "No table widget for available packages existing" << endl;
+ return false;
+ }
+
+ if ( !selectable )
+ {
+ NCERR << "Package pointer not valid" << endl;
+ return false;
+ }
+
+ // clear the package table
+ pkgTable->itemsCleared ();
+
+ NCDBG << "Number of available packages: " << selectable->availableObjs() << endl;
+
+ // show all availables
+ zypp::ui::Selectable::available_iterator
+ b = selectable->availableBegin (),
+ e = selectable->availableEnd (),
+ it;
+ for (it = b; it != e; ++it)
+ {
+ if ( selectable->installedObj() &&
+ selectable->installedObj()->edition() == (*it)->edition() &&
+ selectable->installedObj()->arch() == (*it)->arch() )
+ // FIXME: In future releases, also the vendor will make a difference
+ {
+ addInstalled = false;
+ }
+ pkgTable->createListEntry( tryCastToZyppPkg (*it), selectable );
+ }
+ if ( selectable->hasInstalledObj() && addInstalled )
+ {
+ pkgTable->createListEntry( tryCastToZyppPkg (selectable->installedObj()), selectable );
+ }
+
+ // show the package list
+ pkgTable->drawList();
+
+ if ( pkgTable->getNumLines() > 0 )
+ {
+ pkgTable->setCurrentItem( 0 );
+ }
+
+ return true;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// showSelPackages
+//
+// Fills the package table with the list of packages of the given selection
+//
+bool NCPackageSelector::showSelPackages( const YCPString & label, const set<string> & wanted )
+{
+ NCPkgTable * packageList = getPackageList();
+
+ if ( !packageList )
+ {
+ UIERR << "Widget is not a valid NCPkgTable widget" << endl;
+ return false;
+ }
+
+ // clear the package table
+ packageList->itemsCleared ();
+
+ set<string>::iterator not_found = wanted.end ();
+
+ std::vector<ZyppSel> sorted;
+ sorted.reserve (wanted.size ());
+
+ // find the objects for the names
+ ZyppPoolIterator
+ b = zyppPkgBegin(),
+ e = zyppPkgEnd(),
+ it;
+ for ( it = b; it != e; ++it )
+ {
+ string name = (*it)->name(); // omitted theObj
+
+ if ( wanted.find (name) != not_found )
+ {
+ ZyppPkg zyppPkg = tryCastToZyppPkg( (*it)->theObj() );
+ if ( zyppPkg )
+ {
+ sorted.push_back (*it);
+ }
+ }
+ }
+
+ // sort it and insert it to the list
+ sort (sorted.begin (), sorted.end (), sortByName);
+ {
+ std::vector<ZyppSel>::iterator
+ b = sorted.begin (),
+ e = sorted.end (),
+ it;
+ for ( it = b; it != e; ++it )
+ {
+ ZyppPkg zyppPkg = tryCastToZyppPkg( (*it)->theObj() );
+ // already know that it is valid
+ packageList->createListEntry( zyppPkg, *it );
+ }
+ }
+
+ // show the package table
+ packageList->drawList();
+
+ if ( !label.isNull() )
+ {
+ NCDBG << "Filter: " << label->toString() << endl;
+
+ // show the selected filter label
+ if ( filterLabel )
+ {
+ filterLabel->setLabel( label->toString() );
+ }
+ }
+
+ return true;
+
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// fillSearchList
+//
+// Fills the package table
+//
+bool NCPackageSelector::fillSearchList( const string & expr,
+ bool ignoreCase,
+ bool checkName,
+ bool checkSummary,
+ bool checkDescr,
+ bool checkProvides,
+ bool checkRequires )
+{
+ NCPkgTable * packageList = getPackageList();
+
+ if ( !packageList )
+ {
+ return false;
+ }
+
+ // clear the package table
+ packageList->itemsCleared ();
+
+// FIXME filter it inside zypp
+ ZyppPoolIterator b = zyppPkgBegin ();
+ ZyppPoolIterator e = zyppPkgEnd ();
+ ZyppPoolIterator i;
+
+ // get the package list and sort it
+ list<ZyppSel> pkgList( b, e );
+ pkgList.sort( sortByName );
+
+ // fill the package table
+ list<ZyppSel>::iterator listIt = pkgList.begin();
+ ZyppPkg pkg;
+ string description = "";
+ string provides = "";
+ string requires = "";
+
+ while ( listIt != pkgList.end() )
+ {
+ if ( (*listIt)->installedObj() )
+ pkg = tryCastToZyppPkg ((*listIt)->installedObj());
+ else
+ pkg = tryCastToZyppPkg ((*listIt)->theObj());
+
+ if ( pkg )
+ {
+ if ( checkDescr )
+ {
+ zypp::Text value = pkg->description();
+ description = createDescrText( value );
+ }
+ if ( checkProvides )
+ {
+ zypp::CapSet value = pkg->dep (zypp::Dep::PROVIDES);
+ provides = createRelLine( value );
+ }
+ if ( checkRequires )
+ {
+ zypp::CapSet value = pkg->dep (zypp::Dep::REQUIRES);
+ requires = createRelLine( value );
+ }
+ if ( ( checkName && match( pkg->name(), expr, ignoreCase )) ||
+ ( checkSummary && match( pkg->summary(), expr, ignoreCase) ) ||
+ ( checkDescr && match( description, expr, ignoreCase) ) ||
+ ( checkProvides && match( provides, expr, ignoreCase) ) ||
+ ( checkRequires && match( requires, expr, ignoreCase) )
+ )
+ {
+ // search sucessful
+ packageList->createListEntry( pkg, *listIt );
+ }
+ }
+
+ ++listIt;
+ }
+
+ // show the package list
+ packageList->drawList();
+
+ // set filter label to 'Search'
+ if ( filterLabel )
+ {
+ filterLabel->setText( NCPkgNames::SearchResults() );
+ }
+
+ return true;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// fillPatchSearchList
+//
+// Fills the patch list with search results
+//
+bool NCPackageSelector::fillPatchSearchList( const string & expr )
+{
+ NCPkgTable * packageList = getPackageList();
+
+ if ( !packageList )
+ {
+ return false;
+ }
+
+ // clear the patch list
+ packageList->itemsCleared ();
+ // get the patch list and sort it
+ list<ZyppSel> patchList( zyppPatchesBegin (), zyppPatchesEnd () );
+ patchList.sort( sortByName );
+ list<ZyppSel>::iterator listIt = patchList.begin();
+
+ while ( listIt != patchList.end() )
+ {
+ ZyppPatch patchPtr = tryCastToZyppPatch( ( *listIt)->theObj() );
+
+ if ( patchPtr )
+ {
+ if ( match( (*listIt)->name(), expr, true ) )
+ {
+ // search sucessful
+ packageList->createPatchEntry( patchPtr, *listIt );
+ }
+ }
+ ++listIt;
+ }
+ // show the patch list with search result
+ packageList->drawList();
+
+ // set filter label to 'Search'
+ if ( filterLabel )
+ {
+ filterLabel->setLabel( NCPkgNames::SearchResults() );
+ }
+
+ return true;
+}
+
+
+///////////////////////////////////////////////////////////////////
+//
+// fillPatchList
+//
+// Fills the package table with the list of YOU patches
+//
+bool NCPackageSelector::fillPatchList( string filter )
+{
+ NCPkgTable * packageList = getPackageList();
+
+ if ( !packageList )
+ {
+ UIERR << "No valid NCPkgTable widget" << endl;
+ return false;
+ }
+
+ // clear list of patches
+ packageList->itemsCleared ();
+
+ // get the patch list and sort it
+ list<ZyppSel> patchList( zyppPatchesBegin (), zyppPatchesEnd () );
+ patchList.sort( sortByName );
+ list<ZyppSel>::iterator listIt = patchList.begin();
+
+ while ( listIt != patchList.end() )
+ {
+ ZyppPatch patchPtr = tryCastToZyppPatch( ( *listIt)->theObj() );
+
+ if ( patchPtr )
+ {
+ checkPatch( patchPtr, *listIt, filter );
+ }
+ ++listIt;
+ }
+
+ if ( filter == "installable"
+ && packageList->getNumLines() == 0 )
+ {
+ packageList->createInfoEntry( NCPkgNames::NoPatches() );
+ }
+
+ // show the patches
+ packageList->drawList();
+
+ // show the selected filter label
+ if ( filterLabel )
+ {
+ if ( filter == "installable" )
+ {
+ // show common label "Online Update Patches"
+ filterLabel->setLabel( NCPkgNames::YOUPatches() );
+ }
+ else if ( filter == "installed" )
+ {
+ filterLabel->setLabel( NCPkgNames::InstPatches() );
+ }
+ else
+ {
+ filterLabel->setLabel( NCPkgNames::Patches() );
+ }
+ }
+
+ return true;
+}
+
+
+///////////////////////////////////////////////////////////////////
+//
+// fillUpdateList
+//
+//
+bool NCPackageSelector::fillUpdateList( )
+{
+ NCPkgTable * packageList = getPackageList();
+
+ if ( !packageList )
+ {
+ UIERR << "Widget is not a valid NCPkgTable widget" << endl;
+ return false;
+ }
+
+ // clear the package table
+ packageList->itemsCleared ();
+
+ listzypp::PoolItem_Ref problemList = zypp::getZYpp()->resolver()->problematicUpdateItems();
+
+ for ( listzypp::PoolItem_Ref::const_iterator it = problemList.begin();
+ it != problemList.end();
+ ++it )
+ {
+ ZyppPkg pkg = tryCastToZyppPkg( (*it).resolvable() );
+
+ if ( pkg )
+ {
+ ZyppSel slb = selMapper.findZyppSel( pkg );
+
+ if ( slb )
+ {
+ NCMIL << "Problematic package: " << pkg->name().c_str() << " " <<
+ pkg->edition().asString().c_str() << endl;
+ packageList->createListEntry( pkg, slb );
+ }
+ }
+
+ }
+
+ // show the list
+ packageList->drawList();
+
+ // show the selected filter label
+ if ( filterLabel )
+ {
+ filterLabel->setLabel( NCPkgNames::UpdateProblem() );
+ }
+
+ return true;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// fillPatchPackages
+//
+//
+bool NCPackageSelector::fillPatchPackages ( NCPkgTable * pkgTable, ZyppObj objPtr, bool versions )
+{
+ if ( !pkgTable || !objPtr )
+ return false;
+
+ pkgTable->itemsCleared ();
+
+ std::set<ZyppSel> patchSelectables;
+ ZyppPatch patchPtr = tryCastToZyppPatch( objPtr );
+
+ if ( !patchPtr )
+ return false;
+
+ ZyppPatchContents patchContents( patchPtr );
+
+ zypp::Patch::AtomList atomList = patchPtr->atoms();
+ NCMIL << "Filtering for patch: " << patchPtr->name().c_str() << " number of atoms: " << atomList.size() << endl ;
+
+ for ( ZyppPatchContentsIterator it = patchContents.begin();
+ it != patchContents.end();
+ ++it )
+ {
+ ZyppPkg pkg = tryCastToZyppPkg( *it );
+
+ if ( pkg )
+ {
+ NCMIL << "Patch package found: " << (*it)->name().c_str() << endl;
+ ZyppSel sel = selMapper.findZyppSel( pkg );
+
+ if ( sel )
+ {
+ if ( inContainer( patchSelectables, sel ) )
+ {
+ NCMIL << "Suppressing duplicate selectable: " << (*it)->name().c_str() << "-" <<
+ (*it)->edition().asString().c_str() << " " <<
+ (*it)->arch().asString().c_str() << endl;
+ }
+ else
+ {
+ patchSelectables.insert( sel );
+ NCDBG << (*it)->name().c_str() << ": Version: " << pkg->edition().asString() << endl;
+
+ pkgTable->createListEntry( pkg, sel );
+
+ if ( versions ) // additionally show all availables
+ {
+ zypp::ui::Selectable::available_iterator
+ b = sel->availableBegin (),
+ e = sel->availableEnd (),
+ it;
+ for (it = b; it != e; ++it)
+ {
+ ZyppPkg pkgAvail = tryCastToZyppPkg (*it);
+ if ( pkgAvail )
+ {
+ if ( pkg->edition() != pkgAvail->edition() ||
+ pkg->arch() != pkgAvail->arch() )
+ {
+ pkgTable->createListEntry( pkgAvail, sel );
+ }
+ }
+ }
+
+ } // if ( versions )
+ }
+ }
+ }
+ else // No ZyppPkg - some other kind of object (script, message)
+ {
+ if ( zypp::isKindzypp::Script ( *it ) )
+ {
+ vector<string> pkgLine;
+ pkgLine.reserve(4);
+
+ pkgLine.push_back( (*it)->name() );
+ pkgLine.push_back( " " ); // versions empty
+ pkgLine.push_back( " " );
+ pkgLine.push_back( NCPkgNames::Script() );
+
+ pkgTable->addLine( S_NoInst,
+ pkgLine,
+ ZyppObj(),
+ ZyppSel()
+ );
+ }
+ else
+ {
+ y2debug( "Found unknown atom of kind %s: %s",
+ (*it)->kind().asString().c_str(),
+ (*it)->name().c_str() );
+ }
+ }
+ }
+
+ // show the list
+ pkgTable->drawList();
+
+ return true;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// fillSummaryList
+//
+// Shows the installation summary or lists all installed packages.
+//
+bool NCPackageSelector::fillSummaryList( NCPkgTable::NCPkgTableListType type )
+{
+ NCPkgTable * packageList = getPackageList();
+
+ if ( !packageList )
+ {
+ UIERR << "No valid NCPkgTable widget" << endl;
+ return false;
+ }
+
+ // clear the package table
+ packageList->itemsCleared ();
+
+ // get the package list and sort it
+ list<ZyppSel> pkgList( zyppPkgBegin (), zyppPkgEnd () );
+ pkgList.sort( sortByName );
+
+ // fill the package table
+ list<ZyppSel>::iterator listIt;
+ ZyppPkg pkgPtr;
+
+ // If the dependency check is off, the dependencies will not be solved for
+ // the installation summary.
+ // This is not necessary because the dependencies will be solved and the
+ // "Automatic Changes" list will be shown if the OK button is pressed.
+ if ( !autoCheck )
+ {
+ // showPackageDependencies( true );
+ }
+
+ for ( listIt = pkgList.begin(); listIt != pkgList.end(); ++listIt )
+ {
+ ZyppSel selectable = *listIt;
+ ZyppPkg pkg = tryCastToZyppPkg (selectable->theObj ());
+ // show all matching packages
+ switch ( type )
+ {
+ case NCPkgTable::L_Changes: {
+ if ( selectable->status() != S_NoInst
+ && selectable->status() != S_KeepInstalled )
+ {
+ packageList->createListEntry( pkg, selectable );
+ }
+ break;
+ }
+ case NCPkgTable::L_Installed: {
+ if ( selectable->status() == S_KeepInstalled )
+ {
+ packageList->createListEntry( pkg, selectable );
+ }
+ break;
+ }
+ default:
+ break;
+ }
+ }
+
+ // show the package list
+ packageList->drawList();
+
+ // show the selected filter label
+ if ( filterLabel )
+ {
+ filterLabel->setLabel( NCPkgNames::InstSummary() );
+ }
+
+ return true;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// fillPackageList
+//
+// Fills the package table with the list of packages matching
+// the selected filter
+//
+bool NCPackageSelector::fillPackageList( const YCPString & label, YStringTreeItem * rpmGroup )
+{
+ NCPkgTable * packageList = getPackageList();
+
+ if ( !packageList )
+ {
+ UIERR << "No valid NCPkgTable widget" << endl;
+ return false;
+ }
+
+ // clear the package table
+ packageList->itemsCleared ();
+
+ // get the package list and sort it
+ list<ZyppSel> pkgList( zyppPkgBegin (), zyppPkgEnd () );
+ pkgList.sort( sortByName );
+
+ // fill the package table
+ list<ZyppSel>::iterator listIt;
+ ZyppPkg pkgPtr;
+
+
+ for ( listIt = pkgList.begin(); listIt != pkgList.end(); ++listIt )
+ {
+ ZyppSel selectable = *listIt;
+
+ // Multiple instances of this package may or may not be in the same
+ // RPM group, so let's check both the installed version (if there
+ // is any) and the candidate version.
+ //
+ // Make sure we emit only one filterMatch() signal if both exist
+ // and both are in the same RPM group. We don't want multiple list
+ // entries for the same package!
+
+ bool match =
+ checkPackage( selectable->candidateObj(), selectable, rpmGroup ) ||
+ checkPackage( selectable->installedObj(), selectable, rpmGroup );
+
+ // If there is neither an installed nor a candidate package, check
+ // any other instance.
+
+ if ( ! match &&
+ ! selectable->installedObj() &&
+ ! selectable->candidateObj() )
+ checkPackage( selectable->theObj(), selectable, rpmGroup );
+
+ }
+
+ // show the package list
+ packageList->drawList();
+
+ NCMIL << "Fill package list" << endl;
+
+ if ( !label.isNull() )
+ {
+ // show the selected filter label
+ if ( filterLabel )
+ {
+ filterLabel->setText( label->toString() );
+ }
+ }
+
+ return true;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// fillRepoFilterList
+//
+// Fills the package table with packages from selected repository
+//
+
+bool NCPackageSelector::fillRepoFilterList( ZyppRepo repo)
+{
+ NCMIL << "Collecting packages in selected repository" << endl;
+
+ NCPkgTable *pkgList = getPackageList();
+ //clean the pkg table first
+ pkgList->itemsCleared ();
+
+ //sets to store matching packages
+ set <ZyppSel> exactMatch;
+ set <ZyppSel> nearMatch;
+
+ //iterate through the package pool
+ for ( ZyppPoolIterator it = zyppPkgBegin();
+ it != zyppPkgEnd();
+ ++it )
+ {
+ //we have candidate object in this repository
+ if ( (*it)->candidateObj() &&
+ (*it)->candidateObj()->repository() == repo )
+ {
+ exactMatch.insert( *it );
+ }
+ //something else (?)
+ else
+ {
+ zypp::ui::Selectable::available_iterator pkg_it = (*it)->availableBegin();
+
+ while ( pkg_it != (*it)->availableEnd() )
+ {
+ if ( (*pkg_it)->repository() == repo )
+ nearMatch.insert( *it );
+
+ ++pkg_it;
+ }
+ }
+
+ }
+
+ //finally create pkg table list entries
+ set<ZyppSel>::const_iterator e_it = exactMatch.begin();
+ while ( e_it != exactMatch.end() )
+ {
+ ZyppPkg pkg = tryCastToZyppPkg( (*e_it)->theObj() );
+ pkgList->createListEntry ( pkg, *e_it);
+ e_it++;
+ }
+
+ set<ZyppSel>::const_iterator n_it = nearMatch.begin();
+ while ( n_it != nearMatch.end() )
+ {
+ ZyppPkg pkg = tryCastToZyppPkg( (*n_it)->theObj() );
+ pkgList->createListEntry ( pkg, *n_it);
+ n_it++;
+ }
+
+ //and show the whole stuff to the user
+ pkgList->drawList();
+
+ if ( repoPopup && filterLabel )
+ {
+ ZyppProduct product = repoPopup->findProductForRepo( repo );
+ if ( product )
+ {
+ filterLabel->setLabel( product->summary() );
+ }
+ }
+
+ return true;
+
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// match
+//
+
+bool NCPackageSelector::match ( string s1, string s2, bool ignoreCase )
+{
+ string::iterator pos;
+
+ if ( ignoreCase )
+ {
+ pos = search( s1.begin(), s1.end(),
+ s2.begin(), s2.end(),
+ ic_compare );
+ }
+ else
+ {
+ pos = search( s1.begin(), s1.end(),
+ s2.begin(), s2.end() );
+ }
+
+ return ( pos != s1.end() );
+}
+
+
+///////////////////////////////////////////////////////////////////
+//
+// checkPackage
+//
+//
+bool NCPackageSelector::checkPackage( ZyppObj opkg, ZyppSel slb,
+ YStringTreeItem * rpmGroup )
+{
+ ZyppPkg pkg = tryCastToZyppPkg (opkg);
+ if ( ! pkg || ! rpmGroup )
+ return false;
+
+ NCPkgTable * packageList = getPackageList();
+
+ if ( !packageList )
+ {
+ UIERR << "Widget is not a valid NCPkgTable widget" << endl;
+ return false;
+ }
+
+ string group_str = _rpmGroupsTree->rpmGroup (rpmGroup);
+ // is the requested rpm group a prefix of this package's group?
+ if ( pkg->group ().find (group_str) == 0 )
+ {
+ packageList->createListEntry( pkg, slb );
+
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+}
+
+
+// patches
+
+///////////////////////////////////////////////////////////////////
+//
+// checkPatch
+//
+//
+bool NCPackageSelector::checkPatch( ZyppPatch patchPtr,
+ ZyppSel selectable,
+ string filter )
+
+{
+ NCPkgTable * packageList = getPackageList();
+ bool displayPatch = false;
+
+ if ( !packageList || !patchPtr
+ || !selectable )
+ {
+ UIERR << "Widget is not a valid NCPkgTable widget" << endl;
+ return false;
+ }
+
+ if ( filter == "all" )
+ {
+ displayPatch = true;
+ }
+ else if ( filter == "installed" )
+ {
+ if ( selectable->hasInstalledObj() )
+ displayPatch = true;
+ }
+ else if ( filter == "installable" )
+ {
+ if ( selectable->hasInstalledObj() ) // patch installed?
+ {
+ // display only if broken
+ if ( selectable->installedPoolItem().status().isIncomplete() )
+ {
+ displayPatch = true;
+ NCWAR << "Installed patch is broken: " << patchPtr->name().c_str() << " - "
+ << patchPtr->summary().c_str() << endl;
+ }
+ }
+ else // patch not installed
+
+ {
+ if (selectable->hasCandidateObj() &&
+ selectable->candidatePoolItem().status().isSatisfied() )
+ {
+ //patch not installed, but it is satisfied (updated to the version patch requires)
+ //all that is missing are patch metadata, so let's display the patch
+
+ displayPatch = true;
+
+ NCMIL << "Patch satisfied, but not installed yet: " << patchPtr->name().c_str() << " - "
+ << patchPtr->summary().c_str() << endl;
+ }
+ }
+
+ if (selectable->hasCandidateObj()) {
+
+ // isNeeded(): this patch is relevant (contains updates for installed packages)
+ // isSatisfied(): all packages are installed, therefore the isNeeded() flag
+ // isn't set. BUT the patch meta data aren't installed and therefore it makes
+ // sense to install the patch
+ if ( selectable->candidatePoolItem().status().isNeeded())
+ {
+ displayPatch = true;
+ }
+ else
+ {
+ NCMIL << "Patch not needed: " << patchPtr->name().c_str() << " - "
+ << patchPtr->summary().c_str() << endl;
+ }
+ }
+ }
+ else if ( filter == "new" )
+ {
+ if ( !selectable->hasInstalledObj() )
+ displayPatch = true;
+ }
+ else if ( filter == "security" )
+ {
+ if ( patchPtr->category() == "security" )
+ displayPatch = true;
+ }
+
+ else if ( filter == "recommended" )
+ {
+ if ( patchPtr->category() == "recommended" )
+ displayPatch = true;
+ }
+ else if ( filter == "optional" )
+ {
+ if ( patchPtr->category() == "optional" )
+ displayPatch = true;
+ }
+ else if ( filter == "YaST2" )
+ {
+ if ( patchPtr->category() == "yast" )
+ displayPatch = true;
+ }
+
+ if ( displayPatch )
+ packageList->createPatchEntry( patchPtr, selectable );
+
+ return displayPatch;
+}
+
+void NCPackageSelector::importSelectable( ZyppSel selectable, bool isWanted, const char* kind )
+{
+ ZyppStatus oldStatus = selectable->status();
+ ZyppStatus newStatus = oldStatus;
+
+ //Package/Pattern is on the list
+ if (isWanted)
+ {
+ switch (oldStatus)
+ {
+ //Keep status for installed ones
+ case S_Install:
+ case S_AutoInstall:
+ case S_Update:
+ case S_AutoUpdate:
+ case S_KeepInstalled:
+ case S_Protected:
+ newStatus = oldStatus;
+ break;
+
+ //Keep also those marked for deletion
+ case S_Del:
+ case S_AutoDel:
+ newStatus = S_KeepInstalled;
+ NCDBG << "Keeping " << kind << " " << selectable->name().c_str() << endl;
+ break;
+
+ //Add not yet installed pkgs (if they have candidate available)
+ case S_NoInst:
+ case S_Taboo:
+ if ( selectable->hasCandidateObj() )
+ {
+ newStatus = S_Install;
+ NCDBG << "Adding " << kind << " " << selectable->name().c_str() << endl;
+ }
+ else
+ {
+ NCDBG << "Cannot add " << kind << " " << selectable->name().c_str() <<
+ " " << " - no candidate." << endl;
+ }
+ break;
+ }
+ }
+ //Package/Pattern is not on the list
+ else
+ {
+ switch (oldStatus)
+ {
+ //Mark installed ones for deletion
+ case S_Install:
+ case S_AutoInstall:
+ case S_Update:
+ case S_AutoUpdate:
+ case S_KeepInstalled:
+ case S_Protected:
+ newStatus = S_Del;
+ NCDBG << "Deleting " << kind << " " << selectable->name().c_str() << endl;
+ break;
+
+ //Keep status for not installed, taboo and to-be-deleted
+ case S_Del:
+ case S_AutoDel:
+ case S_NoInst:
+ case S_Taboo:
+ newStatus = oldStatus;
+ break;
+ }
+ }
+
+ if (oldStatus != newStatus)
+ selectable->set_status( newStatus );
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// SearchHandler
+//
+// Opens popup for package search and asks the package manager
+//
+bool NCPackageSelector::SearchHandler( const NCursesEvent& event)
+{
+ NCPkgTable * packageList = getPackageList();
+
+ if ( !packageList || !searchPopup )
+ {
+ return false;
+ }
+
+ // open the search popup
+ NCursesEvent retEvent = searchPopup->showSearchPopup();
+
+ if ( retEvent == NCursesEvent::button )
+ {
+ NCMIL << "Searching for: " << retEvent.result << endl;
+ packageList->showInformation( );
+ }
+ else
+ {
+ NCMIL << "Search is canceled" << endl;
+ }
+
+ packageList->setKeyboardFocus();
+
+ return true;
+}
+
+
+
+
+///////////////////////////////////////////////////////////////////
+//
+// InformationHandler
+//
+// Sets the member variable visibleInfo. If required,
+// replaces the currently active package information widget
+// ( e.g. by the list of available packages ).
+//
+bool NCPackageSelector::InformationHandler( const NCursesEvent& event )
+{
+ NCPkgTable * packageList = getPackageList();
+
+ if ( !packageList
+ || !event.selection
+ || !replacePoint )
+ {
+ NCERR << "*** InformationHandler RETURN false ***" << endl;
+ return false;
+ }
+
+ YMenuItem * info = event.selection;
+
+ NCMIL << "Show info: " << info->label() << endl;
+
+ if ( visibleInfo == info )
+ {
+ // information selection has not changed
+ return true;
+ }
+
+ // set visibleInfo
+ visibleInfo = info;
+
+ if ( infoText )
+ {
+ // RichText widget remains in place
+ if ( ( visibleInfo == longdescrItem ) ||
+ ( visibleInfo == filesItem ) ||
+ ( visibleInfo == pkginfoItem ) )
+ {
+ packageList->showInformation( );
+ return true;
+ }
+ }
+
+ // delete current child of the ReplacePoint
+ YWidget * replaceChild = replacePoint->firstChild();
+ wrect oldSize;
+
+ if ( replaceChild )
+ {
+ oldSize = dynamic_cast(replaceChild)->wGetSize();
+
+ delete replaceChild;
+ // reset all info widgets
+ infoText = 0;
+ versionsList = 0;
+ patchPkgs = 0;
+ patchPkgsVersions = 0;
+ }
+
+ if ( visibleInfo == versionsItem )
+ {
+ // show a package table with all available package versions
+ YTableHeader * tableHeader = new YTableHeader();
+ versionsList = new NCPkgTable( replacePoint, tableHeader );
+ // YDialog::currentDialog()->setInitialSize(); -> doesn't work
+ // call versionsList->setSize() and versionsList->Redraw() instead
+
+ if ( versionsList )
+ {
+ versionsList->setSize( oldSize.Sze.W, oldSize.Sze.H );
+ versionsList->Redraw();
+
+ // set the connection to the NCPackageSelector !!!!
+ versionsList->setPackager( this );
+ // set status strategy
+ NCPkgStatusStrategy * strategy = new AvailableStatStrategy();
+ versionsList->setTableType( NCPkgTable::T_Availables, strategy );
+ versionsList->fillHeader( );
+
+ fillAvailableList( versionsList, packageList->getSelPointer( packageList->getCurrentItem() ) );
+ }
+ }
+// patches
+ else if ( visibleInfo == patchpkgsItem )
+ {
+ // show a package table with packages belonging to a patch
+ YTableHeader * tableHeader = new YTableHeader();
+ patchPkgs = new NCPkgTable( replacePoint, tableHeader );
+
+ if ( patchPkgs )
+ {
+ patchPkgs->setSize( patchPkgs->preferredWidth(), patchPkgs->preferredHeight() );
+ patchPkgs->Redraw();
+
+ // set the connection to the NCPackageSelector !!!!
+ patchPkgs->setPackager( this );
+ // set status strategy - don't set extra strategy, use 'normal' package strategy
+ NCPkgStatusStrategy * strategy = new PackageStatStrategy();
+ patchPkgs->setTableType( NCPkgTable::T_PatchPkgs, strategy );
+ patchPkgs->fillHeader( );
+
+ fillPatchPackages( patchPkgs, packageList->getDataPointer( packageList->getCurrentItem() ) );
+ }
+ }
+ else if ( visibleInfo == pkgversionsItem )
+ {
+ // show a package table with versions of the packages beloning to a patch
+ YTableHeader * tableHeader = new YTableHeader();
+ patchPkgsVersions = new NCPkgTable( replacePoint, tableHeader );
+
+ if ( patchPkgsVersions )
+ {
+ patchPkgsVersions->setSize( oldSize.Sze.W, oldSize.Sze.H );
+ patchPkgsVersions->Redraw();
+
+ patchPkgsVersions->setPackager( this );
+ // set status strategy and table type
+ NCPkgStatusStrategy * strategy = new AvailableStatStrategy();
+ patchPkgsVersions->setTableType( NCPkgTable::T_Availables, strategy );
+
+ patchPkgsVersions->fillHeader( );
+
+ fillPatchPackages( patchPkgsVersions, packageList->getDataPointer( packageList->getCurrentItem() ), true );
+ }
+ }
+ else
+ {
+ // show the rich text widget
+ infoText = new NCRichText( replacePoint, " ");
+
+ if ( infoText )
+ {
+ infoText->setSize( oldSize.Sze.W, oldSize.Sze.H );
+ infoText->Redraw();
+
+ packageList->showInformation( );
+ }
+ }
+
+ packageList->setKeyboardFocus();
+
+ UIMIL << "Change package info to: " << visibleInfo->label() << endl;
+ return true;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// Dependency Handler
+//
+//
+bool NCPackageSelector::DependencyHandler( const NCursesEvent& event )
+{
+ if ( !event.selection )
+ {
+ return false;
+ }
+
+ NCPopupInfo * info = new NCPopupInfo( wpos( (NCurses::lines()-5)/2, (NCurses::cols()-35)/2 ), "",
+ _( "All package dependencies are OK." ),
+ NCPkgNames::OKLabel() );
+ info->setNiceSize( 35, 5 );
+
+ if ( event.selection == showdepsItem )
+ {
+ bool ok = false;
+
+ if ( depsPopup )
+ {
+ NCMIL << "Checking dependencies" << endl;
+ depsPopup->showDependencies( NCPkgPopupDeps::S_Solve, &ok );
+ }
+
+ if ( ok )
+ {
+ info->showInfoPopup();
+ YDialog::deleteTopmostDialog();
+ }
+
+ // update the package list and the disk space info
+ updatePackageList();
+ showDiskSpace();
+ }
+ else if ( event.selection == verifyItem )
+ {
+ verifyPackageDependencies();
+ updatePackageList();
+ showDiskSpace();
+ }
+ else if ( event.selection == autodepsItem )
+ {
+ etcMenu->deleteAllItems();
+
+ autoCheck = false; // reset autoCheck and create new items
+ createEtcMenu();
+ }
+ else if ( event.selection == noautodepsItem )
+ {
+ etcMenu->deleteAllItems();
+
+ autoCheck = true; // set autoCheck and create new items
+ createEtcMenu();
+ }
+
+ NCPkgTable * packageList = getPackageList();
+
+ if ( packageList )
+ {
+ packageList->setKeyboardFocus();
+ }
+
+ return true;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// FilterHandler
+//
+// Opens the popup with rpm group tree, selections ... and display the
+// corresponding package list
+//
+bool NCPackageSelector::FilterHandler( const NCursesEvent& event )
+{
+ NCursesEvent retEvent;
+ NCPkgTable * packageList = getPackageList();
+
+ if ( !packageList
+ || !event.selection )
+ {
+ return false;
+ }
+
+ string selId = getMenuId( event.selection );
+
+ if ( event.selection == groupsItem )
+ {
+ if ( filterPopup )
+ {
+ NCMIL << "Showing RPM groups" << endl;
+ // show the filter popup (fills the package list)
+ retEvent = filterPopup->showFilterPopup( );
+ }
+ }
+ // FIXME - add selectionsItem if really needed
+ // else if ( event.selection == selectionsItem )
+ else if ( event.selection == patternsItem )
+ {
+ if ( patternPopup )
+ {
+ // show the selection popup
+ retEvent = patternPopup->showSelectionPopup( );
+ }
+ }
+ else if ( event.selection == languagesItem )
+ {
+ if ( languagePopup )
+ {
+ // show the selection popup
+ retEvent = languagePopup->showSelectionPopup( );
+ }
+ }
+ else if ( event.selection == reposItem )
+ {
+ if ( repoPopup )
+ {
+ // show the selection popup
+ retEvent = repoPopup->showRepoPopup( );
+ }
+ }
+ else if ( event.selection == searchItem )
+ {
+ // start package search
+ SearchHandler( event );
+ }
+// patches
+// FIXME - compare event.selection with YMenuItem (see above)
+ else if ( selId == NCPkgNames::Recommended()->toString() )
+ {
+ fillPatchList( "recommended" ); // patch kind
+ }
+ else if ( selId == NCPkgNames::Security()->toString() )
+ {
+ fillPatchList( "security" ); // patch kind
+ }
+ else if ( selId == NCPkgNames::Optional()->toString() )
+ {
+ fillPatchList( "optional" ); // patch kind
+ }
+ else if ( selId == NCPkgNames::YaST2Patches()->toString() )
+ {
+ fillPatchList( "YaST2" ); // patch kind
+ }
+ else if ( selId == NCPkgNames::AllPatches()->toString() )
+ {
+ fillPatchList( "all" ); // show all patches
+ }
+ else if ( selId == NCPkgNames::InstalledPatches()->toString() )
+ {
+ fillPatchList( "installed" ); // show installed patches
+ }
+ else if ( selId == NCPkgNames::InstallablePatches()->toString() )
+ {
+ fillPatchList( "installable" ); // show installed patches
+ }
+ else if ( selId == NCPkgNames::NewPatches()->toString() )
+ {
+ fillPatchList( "new" ); // show new patches
+ }
+ // patches end
+ else if ( event.selection == updatelistItem )
+ {
+ fillUpdateList();
+ }
+ else if ( event.selection == whatifItem )
+ {
+ fillSummaryList( NCPkgTable::L_Changes );
+ }
+ else if ( event.selection == installedItem )
+ {
+ fillSummaryList( NCPkgTable::L_Installed );
+ }
+
+ packageList->showInformation();
+ packageList->setKeyboardFocus();
+
+ // return true means: don't leave the event loop in runPkgSelection
+ return true;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// StatusHandler
+//
+// Sets the package status
+//
+bool NCPackageSelector::StatusHandler( const NCursesEvent& event )
+{
+ NCPkgTable * packageList = getPackageList();
+
+ if ( !packageList
+ || !event.selection )
+ {
+ return false;
+ }
+
+ if ( packageList->getNumLines() == 0 )
+ {
+ // nothing to do
+ return true;
+ }
+
+ string selId = getMenuId( event.selection );
+
+ // call the corresponding method of NCPkgTable
+ if ( event.selection == toggleItem )
+ {
+ packageList->toggleObjStatus( );
+ }
+ else if ( event.selection == selectItem )
+ {
+ if ( testMode )
+ diskspacePopup->setDiskSpace( '+' );
+ else
+ packageList->changeObjStatus( '+' );
+ }
+ else if ( event.selection == deleteItem )
+ {
+ if ( testMode )
+ diskspacePopup->setDiskSpace( '-' );
+ else
+ packageList->changeObjStatus( '-' );
+ }
+ else if ( event.selection == updateItem )
+ {
+ if ( testMode )
+ diskspacePopup->checkDiskSpaceRange();
+ else
+ packageList->changeObjStatus( '>' );
+ }
+ else if ( event.selection == tabooItem )
+ {
+ packageList->changeObjStatus( '!' );
+ }
+ else if ( event.selection == notabooItem )
+ {
+ packageList->changeObjStatus( '%' );
+ }
+#if 0
+ // no source install available
+ else if (event.selection == NCPkgNames::SourceYes()->toString() )
+ {
+ packageList->SourceInstall( true );
+ }
+ else if (event.selection == NCPkgNames::SourceNo()->toString() )
+ {
+ packageList->SourceInstall( false );
+ }
+#endif
+ else if ( event.selection == selallItem )
+ {
+ packageList->changeListObjStatus( NCPkgTable::A_Install );
+ }
+ else if (event.selection == deselallItem )
+ {
+ packageList->changeListObjStatus( NCPkgTable::A_DontInstall );
+ }
+ else if (event.selection == delallItem )
+ {
+ packageList->changeListObjStatus( NCPkgTable::A_Delete );
+ }
+ else if (event.selection == dontdelItem )
+ {
+ packageList->changeListObjStatus( NCPkgTable::A_DontDelete );
+ }
+ else if ( event.selection == updnewerItem )
+ {
+ packageList->changeListObjStatus( NCPkgTable::A_UpdateNewer );
+ }
+ else if (event.selection == updallItem )
+ {
+ packageList->changeListObjStatus( NCPkgTable::A_Update );
+ }
+ else if (event.selection == dontupdItem )
+ {
+ packageList->changeListObjStatus( NCPkgTable::A_DontUpdate );
+ }
+
+ packageList->setKeyboardFocus();
+
+ return true;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// DiskinfoHandler
+//
+// Opens a popup with disk space information.
+//
+bool NCPackageSelector::DiskinfoHandler( const NCursesEvent& event )
+{
+ NCPkgTable * packageList = getPackageList();
+
+ if ( diskspacePopup )
+ {
+ diskspacePopup->showInfoPopup( NCPkgNames::DiskspaceLabel() );
+ }
+ if ( packageList )
+ {
+ packageList->setKeyboardFocus();
+ }
+
+ return true;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// LinkHandler
+//
+// Handles hyperlinks in package description.
+//
+bool NCPackageSelector::LinkHandler ( string link )
+{
+ bool found = false;
+ // e.g. link is pkg://hp-officeJet
+ string pkgName = link.substr(6);
+
+ ZyppPoolIterator
+ b = zyppPkgBegin(),
+ e = zyppPkgEnd(),
+ i;
+ for (i = b; i != e; ++i)
+ {
+ ZyppPkg pkgPtr = tryCastToZyppPkg ((*i)->theObj());
+ if ( pkgPtr && pkgPtr->name() == pkgName )
+ {
+ NCMIL << "Package " << pkgName << " found" << endl;
+ // open popup with package info
+ NCPkgPopupDescr * popupDescr = new NCPkgPopupDescr( wpos(1,1), this );
+ popupDescr->showInfoPopup( pkgPtr, *i );
+
+ YDialog::deleteTopmostDialog();
+
+ found = true;
+ }
+ }
+
+ if ( !found )
+ {
+ NCERR << "Package " << pkgName << " NOT found" << endl;
+ // open error popup
+ }
+
+ return found;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// testcase handler
+//
+// generate solver testcase
+//
+bool NCPackageSelector::TestcaseHandler ( const NCursesEvent& event )
+{
+ string testCaseDir = "/var/log/YaST2/solverTestcase";
+
+ NCMIL << "Generating solver test case START" << endl;
+ bool success = zypp::getZYpp()->resolver()->createSolverTestcase( testCaseDir );
+ NCMIL << "Generating solver test case END" << endl;
+
+ if ( success )
+ {
+ NCPopupInfo * info = new NCPopupInfo( wpos( (NCurses::lines()-8)/2, (NCurses::cols()-40)/2 ),
+ "",
+ _("Dependency resolver test case written to ") + "<br>"
+ + testCaseDir
+ );
+ info->setNiceSize( 40, 8 );
+ info->showInfoPopup( );
+
+ YDialog::deleteTopmostDialog();
+ }
+ return success;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// File handler
+//
+// export/import all packages and patterns list to/from file
+//
+bool NCPackageSelector::FileHandler( const NCursesEvent& event )
+{
+ if ( !event.selection )
+ {
+ return false;
+ }
+
+ //Export package list into file
+ if ( event.selection == exportItem )
+ {
+ //Ask for file to save into
+ string filename = YUI::app()->askForSaveFileName( DEFAULT_EXPORT_FILE_NAME,
+ "*.xml",
+ _("Export List of All Packages and Patterns to File" ));
+
+ if ( ! filename.empty() )
+ {
+ zypp::syscontent::Writer writer;
+ const zypp::ResPool & pool = zypp::getZYpp()->pool();
+
+ //some strange C++ magic (c) by ma
+ for_each( pool.begin(), pool.end(),
+ boost::bind( &zypp::syscontent::Writer::addIf,
+ boost::ref(writer),
+ _1));
+
+ try
+ {
+ //open file for writing and try to dump syscontent into it
+ std::ofstream exportFile( filename.c_str() );
+ exportFile.exceptions(std::ios_base::badbit | std::ios_base::failbit );
+ exportFile << writer;
+
+ NCMIL << "Exported list of packages and patterns to " << filename << endl;
+ }
+
+ catch (std::exception & exception)
+ {
+ NCWAR << "Error exporting list of packages and patterns to " << filename << endl;
+
+ //delete partially written file (don't care if it doesn't exist)
+ (void) unlink( filename.c_str() );
+
+ //present error popup to the user
+ NCPopupInfo * errorMsg = new NCPopupInfo( wpos( (NCurses::lines()-5)/2, (NCurses::cols()-40)/2 ),
+ NCPkgNames::ErrorLabel(),
+ _("Error exporting list of packages and patterns to ")
+ // FIXME: String addition is evil for translators!
+ + filename,
+ NCPkgNames::OKLabel(),
+ "");
+ errorMsg->setNiceSize(40,5);
+ NCursesEvent input = errorMsg->showInfoPopup();
+
+ YDialog::deleteTopmostDialog();
+ }
+
+ return true;
+ }
+ }
+
+ //Import package list from file
+ else if ( event.selection == importItem )
+ {
+ //ask for file to open
+ string filename = YUI::app()->askForExistingFile( DEFAULT_EXPORT_FILE_NAME,
+ "*.xml",
+ _("Import List of All Packages and Patterns from File"));
+
+ if ( ! filename.empty() )
+ {
+ NCPkgTable * packageList = getPackageList();
+ NCMIL << "Importing list of packages and patterns from " << filename << endl;
+
+ try
+ {
+ std::ifstream importFile ( filename.c_str() );
+ zypp::syscontent::Reader reader (importFile);
+
+ //maps to store package/pattern data into
+ map importPkgs;
+ map importPatterns;
+
+ //Import syscontent reader to a map $[ "package_name" : pointer_to_data]
+ for (zypp::syscontent::Reader::const_iterator it = reader.begin();
+ it != reader.end();
+ it ++ )
+ {
+ string kind = it->kind();
+
+ // importMapPair => std::pair
+ if ( kind == "package" )
+ importPkgs.insert( importMapPair( it->name(), *it ) );
+ else if ( kind == "pattern" )
+ importPatterns.insert( importMapPair( it->name(), *it ) );
+ }
+
+ NCMIL << "Found " << importPkgs.size() << " packages and " << importPatterns.size() << " patterns." << endl;
+
+ //Change status of appropriate packages and patterns
+ for (ZyppPoolIterator it = zyppPkgBegin();
+ it != zyppPkgEnd();
+ it++ )
+ {
+ ZyppSel selectable = *it;
+ //isWanted => package name found in importPkgs map
+ importSelectable ( *it, importPkgs.find( selectable->name() ) != importPkgs.end(), "package" );
+ }
+
+ for (ZyppPoolIterator it = zyppPatternsBegin();
+ it != zyppPatternsEnd();
+ it++ )
+ {
+ ZyppSel selectable = *it;
+ importSelectable ( *it, importPatterns.find( selectable->name() ) != importPatterns.end(), "pattern" );
+ }
+
+ //Switch to installation summary filter
+ fillSummaryList(NCPkgTable::L_Changes);
+
+ //... and finally display the result
+ packageList->showInformation();
+ packageList->setKeyboardFocus();
+
+ return true;
+ }
+ catch ( const zypp::Exception & exception )
+ {
+ NCWAR << "Error importing list of packages and patterns from" << filename << endl;
+
+ NCPopupInfo * errorMsg = new NCPopupInfo( wpos( (NCurses::lines()-5)/2, (NCurses::cols()-40)/2) ,
+ NCPkgNames::ErrorLabel(),
+ _("Error importing list of packages and patterns from ")
+ // FIXME: String addition is evil for translators!
+ + filename,
+ NCPkgNames::OKLabel(),
+ "");
+ errorMsg->setNiceSize(40,5);
+ NCursesEvent input = errorMsg->showInfoPopup();
+
+ YDialog::deleteTopmostDialog();
+ }
+ }
+ }
+ return true;
+}
+///////////////////////////////////////////////////////////////////
+//
+// HelpHandler
+//
+// Show the help popup
+//
+bool NCPackageSelector::HelpHandler( const NCursesEvent& event )
+{
+ NCPkgTable * packageList = getPackageList();
+ string text = "";
+ string headline = NCPkgNames::PackageHelp();
+
+ if ( !event.selection )
+ {
+ return false;
+ }
+
+ string selId = getMenuId( event.selection );
+
+ if ( selId == NCPkgNames::GeneralHelp()->toString() )
+ {
+ text += NCPkgNames::HelpPkgInst1();
+ text += NCPkgNames::HelpPkgInst12();
+ text += NCPkgNames::HelpPkgInst13();
+ text += NCPkgNames::HelpPkgInst2();
+ text += NCPkgNames::HelpPkgInst3();
+ text += NCPkgNames::HelpPkgInst4();
+ text += NCPkgNames::HelpPkgInst5();
+ text += NCPkgNames::HelpPkgInst6();
+ }
+ else if ( selId == NCPkgNames::StatusHelp()->toString() )
+ {
+ text += NCPkgNames::HelpOnStatus1();
+ text += NCPkgNames::HelpOnStatus2();
+ text += NCPkgNames::HelpOnStatus3();
+ text += NCPkgNames::HelpOnStatus4();
+ text += NCPkgNames::HelpOnStatus5();
+ text += NCPkgNames::HelpOnStatus6();
+ text += NCPkgNames::HelpOnStatus7();
+ }
+ else if ( selId == NCPkgNames::UpdateHelp()->toString() )
+ {
+ text += NCPkgNames::HelpOnUpdate();
+ }
+ else if ( selId == NCPkgNames::SearchHelp()->toString() )
+ {
+ headline = NCPkgNames::SearchHeadline();
+ text += NCPkgNames::HelpOnSearch();
+ }
+
+ // open the popup with the help text
+ NCPopupInfo * pkgHelp = new NCPopupInfo( wpos( (NCurses::lines()*8)/100, (NCurses::cols()*18)/100 ),
+ headline,
+ text
+ );
+ pkgHelp->setNiceSize( (NCurses::cols()*65)/100, (NCurses::lines()*85)/100 );
+ pkgHelp->showInfoPopup( );
+
+ YDialog::deleteTopmostDialog();
+
+ if ( packageList )
+ {
+ packageList->setKeyboardFocus();
+ }
+
+ return true;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// YOUHelpHandler
+//
+// Show the Online Update Help
+//
+bool NCPackageSelector::YouHelpHandler( const NCursesEvent& event )
+{
+ NCPkgTable * packageList = getPackageList();
+ string text = "";
+
+ text += NCPkgNames::YouHelp1();
+ text += NCPkgNames::YouHelp2();
+ text += NCPkgNames::YouHelp3();
+
+ // open the popup with the help text
+ NCPopupInfo * youHelp = new NCPopupInfo( wpos( NCurses::lines()/3, NCurses::cols()/6 ),
+ NCPkgNames::YouHelp(),
+ text
+ );
+ youHelp->setNiceSize( (NCurses::cols()*2)/3, NCurses::lines()/3 );
+ youHelp->showInfoPopup( );
+
+ YDialog::deleteTopmostDialog();
+
+ if ( packageList )
+ {
+ packageList->setKeyboardFocus();
+ }
+
+ return true;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// CancelHandler
+//
+// Cancel button handler.
+//
+bool NCPackageSelector::CancelHandler( const NCursesEvent& event )
+{
+ bool changes = diffState ();
+
+ if (changes) {
+ // show a popup and ask the user
+ NCPopupInfo * cancelMsg = new NCPopupInfo( wpos( (NCurses::lines()-8)/2, (NCurses::cols()-45)/2 ),
+ NCPkgNames::NotifyLabel(),
+ NCPkgNames::CancelText(),
+ NCPkgNames::YesLabel(),
+ NCPkgNames::NoLabel()
+ );
+ cancelMsg->setNiceSize( 45, 8 );
+ NCursesEvent input = cancelMsg->showInfoPopup( );
+
+ YDialog::deleteTopmostDialog();
+
+ if ( input == NCursesEvent::cancel ) {
+ // don't leave the package installation dialog
+ return true;
+ }
+ }
+
+ restoreState ();
+
+ NCMIL << "Cancel button pressed - leaving package selection" << endl;
+ const_cast(event).result = "cancel";
+
+ // return false, which means stop the event loop (see runPkgSelection)
+ return false;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// OkButtonHandler
+//
+// OK button handler.
+//
+bool NCPackageSelector::OkButtonHandler( const NCursesEvent& event )
+{
+ bool closeDialog = true;
+ bool confirmedAllLicenses = false;
+
+ // check/show dependencies also if youMode == true
+ do
+ {
+ // show the dependency popup
+ if ( showPackageDependencies( true ) )
+ {
+ // don't leave the package installation if the user has clicked on Cancel
+ // in dependency popup because maybe he wants to change his choices
+ closeDialog = false;
+ }
+
+ confirmedAllLicenses = showPendingLicenseAgreements();
+
+ } while ( !confirmedAllLicenses && closeDialog );
+
+ if ( !youMode ) // don't show automatic changes if YOU mode
+ {
+ // show the automatic changes list
+ NCPkgPopupTable * autoChangePopup = new NCPkgPopupTable( wpos( 3, 8), this );
+ NCursesEvent input = autoChangePopup->showInfoPopup();
+
+ YDialog::deleteTopmostDialog();
+
+ if ( input == NCursesEvent::cancel )
+ {
+ // user clicked on Cancel
+ closeDialog = false;
+ }
+ }
+
+ if ( diskspacePopup )
+ {
+ string message = "";
+ message = diskspacePopup->checkDiskSpace();
+ if ( message != "" )
+ {
+ // open the popup e.g. with the text "/usr needs 50 MB more disk space"
+ NCPopupInfo * spaceMsg = new NCPopupInfo( wpos( (NCurses::lines()-10)/2, (NCurses::cols()-50)/2 ),
+ NCPkgNames::ErrorLabel(),
+ NCPkgNames::DiskSpaceError() + "<br>" + message,
+ NCPkgNames::OKLabel(),
+ NCPkgNames::CancelLabel() );
+
+ spaceMsg->setNiceSize( 50, 10 );
+ NCursesEvent input = spaceMsg->showInfoPopup( );
+
+ YDialog::deleteTopmostDialog();
+
+ if ( input == NCursesEvent::cancel )
+ {
+ // disk space error warning returned `cancel
+ closeDialog = false;
+ }
+ }
+ }
+
+ if ( closeDialog )
+ {
+ // clear the saved states
+ // could free some memory?
+ // clearSaveState ();
+
+ const_cast(event).result = "accept";
+ NCMIL << "OK button pressed - leaving package selection, starting installation" << endl;
+
+ // return false, leave the package selection
+ return false;
+ }
+ else
+ {
+ NCPkgTable * packageList = getPackageList();
+ if ( packageList )
+ {
+ packageList->setKeyboardFocus();
+ }
+ // don't leave the dialog
+ return true;
+ }
+}
+
+bool NCPackageSelector::showPendingLicenseAgreements()
+{
+ bool allConfirmed = true;
+
+ if ( youMode )
+ allConfirmed = showPendingLicenseAgreements( zyppPatchesBegin(), zyppPatchesEnd() );
+
+ allConfirmed = showPendingLicenseAgreements( zyppPkgBegin(), zyppPkgEnd() ) && allConfirmed;
+
+ return allConfirmed;
+}
+
+bool NCPackageSelector::showPendingLicenseAgreements( ZyppPoolIterator begin, ZyppPoolIterator end )
+{
+ y2milestone( "Showing all pending license agreements" );
+
+ bool allConfirmed = true;
+
+ for ( ZyppPoolIterator it = begin; it != end; ++it )
+ {
+ ZyppSel sel = (*it);
+
+ switch ( sel->status() )
+ {
+ case S_Install:
+ case S_AutoInstall:
+ case S_Update:
+ case S_AutoUpdate:
+
+ if ( sel->candidateObj() )
+ {
+ string licenseText = sel->candidateObj()->licenseToConfirm();
+
+ if ( ! licenseText.empty() )
+ {
+ y2milestone( "Package/Patch %s has a license agreement", sel->name().c_str() );
+
+ if( ! sel->hasLicenceConfirmed() )
+ {
+ allConfirmed = showLicenseAgreement( sel, licenseText ) && allConfirmed;
+ }
+ else
+ {
+ y2milestone( "Package/Patch %s's license is already confirmed", sel->name().c_str() );
+ }
+ }
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ return allConfirmed;
+}
+
+bool NCPackageSelector::showLicenseAgreement( ZyppSel & slbPtr , string licenseText )
+{
+ if ( !slbPtr )
+ return false;
+
+ bool license_confirmed = true;
+ bool ok = true;
+ string pkgName = slbPtr->name();
+
+ NCPopupInfo * info = new NCPopupInfo ( wpos( NCurses::lines()/10, NCurses::cols()/10),
+ NCPkgNames::NotifyLabel(),
+ "<i>" + pkgName + "</i><br><br>"
+ + createDescrText( licenseText ),
+ NCPkgNames::AcceptLabel(),
+ NCPkgNames::CancelLabel() );
+
+ info->setNiceSize( (NCurses::cols() * 80)/100, (NCurses::lines()*80)/100);
+ license_confirmed = info->showInfoPopup( ) != NCursesEvent::cancel;
+
+ if ( !license_confirmed )
+ {
+ // make sure the package won't be installed
+ switch ( slbPtr->status() )
+ {
+ case S_Install:
+ case S_AutoInstall:
+ slbPtr->set_status( S_Taboo );
+ break;
+
+ case S_Update:
+ case S_AutoUpdate:
+ slbPtr->set_status( S_Protected );
+ break;
+
+ default:
+ break;
+ }
+
+ ok = false;
+ } else {
+ NCMIL << "User confirmed license agreement for " << pkgName << endl;
+ slbPtr->setLicenceConfirmed (true);
+ ok = true;
+ }
+
+ YDialog::deleteTopmostDialog();
+
+ return ok;
+}
+
+
+///////////////////////////////////////////////////////////////////
+//
+// showPatchInformation
+//
+// Shows the patch information
+//
+bool NCPackageSelector::showPatchInformation ( ZyppObj objPtr, ZyppSel selectable )
+{
+ ZyppPatch patchPtr = tryCastToZyppPatch( objPtr );
+
+ if ( !patchPtr || !selectable )
+ {
+ NCERR << "Patch not valid" << endl;
+ return false;
+ }
+
+ // if ( visibleInfo->compare( NCPkgNames::PatchDescr() ) == YO_EQUAL )
+ if ( visibleInfo == patchdescrItem )
+ {
+ string descr;
+
+ descr += NCPkgNames::Patch();
+ descr += selectable->name();
+ descr += " ";
+ // the patch size is not available
+ // descr += NCPkgNames::Size();
+ // descr += patchPtr->size().asString( 8 );
+ descr += "<b>";
+ descr += NCPkgNames::PatchKind();
+ descr += ": </b>";
+ descr += patchPtr->category();
+ descr += " ";
+ descr += NCPkgNames::Version();
+ descr += patchPtr->edition().asString();
+ descr += "<br>";
+
+ if ( selectable->hasInstalledObj()
+ && selectable->installedPoolItem().status().isIncomplete() )
+ {
+ descr += _( "----- this patch is broken !!! -----" );
+ descr += "<br>";
+ }
+ // get and format the patch description
+ zypp::Text value = patchPtr->description();
+ descr += createDescrText( value );
+
+ // show the description
+ if ( infoText )
+ {
+ infoText->setValue( descr );
+ }
+ }
+ // else if ( visibleInfo->compare( NCPkgNames::PatchPackages() ) == YO_EQUAL )
+ else if ( visibleInfo == patchpkgsItem )
+ {
+ if ( patchPkgs )
+ {
+ fillPatchPackages ( patchPkgs, objPtr);
+ }
+ }
+ // else if ( visibleInfo->compare( NCPkgNames::PatchPackagesVersions() ) == YO_EQUAL )
+ else if ( visibleInfo == pkgversionsItem )
+ {
+ if ( patchPkgsVersions )
+ {
+ fillPatchPackages ( patchPkgsVersions, objPtr, true);
+ }
+ }
+
+ return true;
+}
+
+
+///////////////////////////////////////////////////////////////////
+//
+// showDependencies
+//
+// Checks and shows the dependencies
+//
+bool NCPackageSelector::showPackageDependencies ( bool doit )
+{
+ bool ok = false;
+ bool cancel = false;
+
+ if ( depsPopup
+ && (doit || autoCheck) )
+ {
+ NCMIL << "Checking dependencies" << endl;
+ cancel = depsPopup->showDependencies( NCPkgPopupDeps::S_Solve, &ok );
+ }
+
+ return cancel;
+}
+
+bool NCPackageSelector::verifyPackageDependencies ()
+{
+ bool ok = false;
+ bool cancel = false;
+
+ NCPopupInfo * info = new NCPopupInfo( wpos( (NCurses::lines()-5)/2, (NCurses::cols()-30)/2 ),
+ "",
+ _( "System dependencies verify OK." ),
+ NCPkgNames::OKLabel()
+ );
+ info->setNiceSize( 30, 5 );
+
+ NCMIL << "Verifying system" << endl;
+
+ if ( depsPopup )
+ {
+ saveState();
+ //call the solver (with S_Verify it displays no popup)
+ cancel = depsPopup->showDependencies( NCPkgPopupDeps::S_Verify, &ok );
+
+ //display the popup with automatic changes
+ NCPkgPopupTable * autoChangePopup = new NCPkgPopupTable( wpos( 3, 8 ), this );
+ NCursesEvent input = autoChangePopup->showInfoPopup();
+
+ if ( input == NCursesEvent::cancel )
+ {
+ // user clicked on Cancel
+ restoreState();
+ cancel = true;
+ }
+ if ( ok && input == NCursesEvent::button )
+ {
+ // dependencies OK, no automatic changes/the user has accepted the changes
+ info->showInfoPopup();
+ }
+ }
+
+ YDialog::deleteTopmostDialog(); // delete NCPopupInfo dialog
+
+ return cancel;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// showDependencies
+//
+// Checks and shows the dependencies
+//
+void NCPackageSelector::showSelectionDependencies ( )
+{
+ showPackageDependencies (true);
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// showPackageInformation
+//
+// Shows the package information
+//
+bool NCPackageSelector::showPackageInformation ( ZyppObj pkgPtr, ZyppSel slbPtr )
+{
+ if ( !pkgPtr )
+ {
+ NCERR << "Package not valid" << endl;
+ return false;
+ }
+ if ( !slbPtr )
+ {
+ NCERR << "Selectable not valid" << endl;
+ return false;
+ }
+
+ if ( visibleInfo == longdescrItem )
+ {
+ // ask the package manager for the description of this package
+ zypp::Text value = pkgPtr->description();
+ string descr = createDescrText( value );
+ NCDBG << "Description: " << descr << endl;
+
+ // show the description
+ if ( infoText )
+ {
+ infoText->setValue( descr );
+ }
+ }
+ else if ( visibleInfo == filesItem )
+ {
+ string text = NCPkgNames::ListOfFiles();
+ // the file list is available only for installed packages
+ ZyppPkg package = tryCastToZyppPkg (slbPtr->installedObj());
+
+ if ( package )
+ {
+ // get the file list from the package manager/show the list
+ list<string> fileList = package->filenames();
+ text += createText( fileList, false ) ;
+ }
+
+ // get the widget id
+ if ( infoText )
+ {
+ infoText->setValue( text );
+ }
+ }
+ else if ( visibleInfo == pkginfoItem )
+ {
+ string instVersion = "";
+ string version = "";
+ string text = "";
+
+ text += slbPtr->name();
+ text += " - ";
+
+ text += pkgPtr->summary();
+ text += "<br>";
+
+ if ( slbPtr->hasBothObjects () )
+ {
+ ZyppObj io = slbPtr->installedObj ();
+ instVersion = io->edition().version();
+ instVersion += "-";
+ instVersion += io->edition().release();
+ ZyppObj co = slbPtr->candidateObj ();
+ version = co->edition().version();
+ version += "-";
+ version += co->edition().release();
+ }
+ else
+ {
+ version = pkgPtr->edition().version();
+ version += "-";
+ version += pkgPtr->edition().release();
+ }
+
+ text += NCPkgNames::Version();
+ text += version;
+ if ( instVersion != "" )
+ {
+ text += " ";
+ text += NCPkgNames::InstVersion();
+ text += instVersion;
+ }
+ text += " ";
+
+ // show the size
+ text += NCPkgNames::Size();
+ text += pkgPtr->size().asString();
+ text += " ";
+
+ ZyppPkg package = tryCastToZyppPkg (pkgPtr);
+ if ( package )
+ {
+ // add the media nr
+ text += NCPkgNames::MediaNo();
+ char num[5];
+ int medianr = package->mediaNr ();
+ sprintf( num, "%d", medianr );
+ text += num;
+ text += "<br>";
+
+ // the license
+ text += NCPkgNames::License();
+ text += package->license();
+ text += " ";
+ text += "<br>";
+
+ // the rpm group
+ text += NCPkgNames::RpmGroup();
+ text += package->group ();
+ text += "<br>";
+ }
+
+ // show Provides:
+ text += NCPkgNames::Provides();
+ zypp::CapSet provides = package->dep (zypp::Dep::PROVIDES);
+ text += createRelLine(provides);
+ text += "<br>";
+
+ // show the authors
+ if ( package )
+ {
+ text += NCPkgNames::Authors();
+ list<string> authors = package->authors(); // zypp::Package
+ text += createText( authors, true );
+ }
+
+ // show the description
+ if ( infoText )
+ {
+ infoText->setValue( text );
+ }
+ }
+ else if ( visibleInfo == versionsItem )
+ {
+ if ( versionsList )
+ {
+ fillAvailableList( versionsList, slbPtr );
+ }
+ }
+ else if ( visibleInfo == relationsItem )
+ {
+ string text = "";
+ text += slbPtr->name();
+ text += " - ";
+
+ text += pkgPtr->summary(); // the summary
+ text += "<br>";
+
+ // show the relations, all of them except provides which is above
+ zypp::Dep deptypes[] = {
+ zypp::Dep::PREREQUIRES,
+ zypp::Dep::REQUIRES,
+ zypp::Dep::CONFLICTS,
+ zypp::Dep::OBSOLETES,
+ zypp::Dep::RECOMMENDS,
+ zypp::Dep::SUGGESTS,
+ zypp::Dep::FRESHENS,
+ zypp::Dep::ENHANCES,
+ zypp::Dep::SUPPLEMENTS,
+ };
+ for (size_t i = 0; i < sizeof (deptypes)/sizeof(deptypes[0]); ++i)
+ {
+ zypp::Dep deptype = deptypes[i];
+ zypp::CapSet relations = pkgPtr->dep (deptype);
+ string relline = createRelLine (relations);
+ if (!relline.empty ())
+ {
+ // FIXME: translate
+ text += "<b>" + deptype.asString () + ": </b>"
+ + relline + "<br>";
+ }
+ }
+
+ // show the package relations
+ if ( infoText )
+ {
+ infoText->setValue( text );
+ }
+ }
+
+ NCDBG << "Showing package information: " << visibleInfo << endl;
+
+ return true;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// createDescrText
+//
+#define DOCTYPETAG "<!-- DT:Rich -->"
+
+string NCPackageSelector::createDescrText( zypp::Text value )
+{
+ string html_text = "";
+
+#ifdef FIXME
+ bool author_format = false;
+ bool htmlFormat = false; /* Is the description coming in html? */
+ /* By default, this is false and the text is plain text. But if the
+ * description contains DOCTYPETAG in the first line, it is considered
+ * to be formatted in html. The yast (this method here) needs not to
+ * do further formatting for the text part.
+ */
+
+ list<string>::const_iterator it = value.begin();
+
+ string line;
+
+ /* Check if the first line is the html tag */
+ if( it != value.end() )
+ {
+ line = (*it);
+ const string htmlIdent(DOCTYPETAG);
+
+ if ( line.length() >= htmlIdent.length() && /* Avoid exception if stringlen < len of tag */
+ line.substr( 0, htmlIdent.length() ) == htmlIdent ) /* first line == DOCTYPETAG ? */
+ {
+ htmlFormat = true; /* indicate that the text is already html formatted */
+ }
+ else
+ {
+ html_text += line + " ";
+ }
+ ++it;
+ }
+
+ /** Loop over the remaining text. **/
+ const string authors("Authors:");
+ while ( it != value.end() )
+ {
+ line = (*it);
+
+ /* Check if authors-line starts */
+ if ( line.length() >= authors.length() && /* Avoid exception if stringlen < len of Authors */
+ line.substr( 0, authors.length() ) == authors )
+ {
+ line = "<br><b>" + line + "</b>";
+ author_format = true;
+ }
+ if ( author_format )
+ {
+ /* every author in his own line */
+ html_text += line + "<br>";
+ }
+ else
+ {
+ html_text += " " + line;
+ if( (! htmlFormat) && (line.length() == 0) )
+ {
+ html_text += "<br>";
+ }
+ else
+ {
+ html_text += " ";
+ }
+ }
+
+ ++it;
+ }
+#else
+ html_text = value;
+#endif
+
+ return html_text;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// updatePackageList
+//
+void NCPackageSelector::updatePackageList()
+{
+ NCPkgTable * packageList = getPackageList();
+
+ if ( packageList )
+ {
+ packageList->updateTable();
+ }
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// createProvides
+//
+string NCPackageSelector::createRelLine( const zypp::CapSet & info )
+{
+ string text = "";
+ zypp::CapSet::const_iterator
+ b = info.begin (),
+ e = info.end (),
+ it;
+ unsigned int i, n = info.size();
+
+ for ( it = b, i = 0; it != e; ++it, ++i )
+ {
+ text = text + (*it).asString();
+ if ( i < n - 1 )
+ {
+ text = text + ", ";
+ }
+ }
+
+ return text;
+}
+
+
+///////////////////////////////////////////////////////////////////
+//
+// createText
+//
+string NCPackageSelector::createText( list<string> info, bool oneline )
+{
+ list<string>::iterator it;
+ string text = "";
+ unsigned int i;
+
+ for ( i = 0, it = info.begin(); it != info.end() && i < 1000; ++it, i++ )
+ {
+ text += (*it);
+ if ( i < info.size()-1 )
+ {
+ if ( oneline && i < 999 )
+ {
+ text += ", ";
+ }
+ else
+ {
+ text += "<br>";
+ }
+ }
+ if ( i == 999 )
+ {
+ text += "...";
+ }
+ }
+
+ return text;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// showDiskSpace()
+//
+void NCPackageSelector::showDiskSpace()
+{
+ zypp::ZYpp::Ptr z = zypp::getZYpp();
+ zypp::DiskUsageCounter::MountPointSet du = z->diskUsage ();
+ zypp::DiskUsageCounter::MountPointSet::iterator
+ b = du.begin (),
+ e = du.end (),
+ it;
+ if (b == e)
+ {
+ // retry after detecting from the target
+ z->setPartitions(zypp::DiskUsageCounter::detectMountPoints ());
+ du = z->diskUsage();
+ b = du.begin ();
+ e = du.end ();
+ }
+
+ zypp::ByteCount diff = 0;
+ for (it = b; it != e; ++it)
+ {
+ diff += (it->pkg_size - it->used_size) * 1024;
+ }
+
+ // show pkg_diff, i.e. total difference of disk space (can be negative in installed system
+ // if packages are deleted)
+ if ( diskspaceLabel )
+ {
+ diskspaceLabel->setText( diff.asString() );
+ }
+
+ // check whether required diskspace enters the warning range
+ if ( diskspacePopup )
+ diskspacePopup->checkDiskSpaceRange( );
+}
+
+
+///////////////////////////////////////////////////////////////////
+//
+// showDownloadSize()
+//
+// total download size of YOU patches
+//
+void NCPackageSelector::showDownloadSize()
+{
+ set<ZyppSel> selectablesToInstall;
+
+ for ( ZyppPoolIterator patches_it = zyppPatchesBegin();
+ patches_it != zyppPatchesEnd();
+ ++patches_it )
+ {
+ ZyppPatch patch = tryCastToZyppPatch( (*patches_it)->theObj() );
+
+ if ( patch )
+ {
+ ZyppPatchContents patchContents( patch );
+
+ for ( ZyppPatchContentsIterator contents_it = patchContents.begin();
+ contents_it != patchContents.end();
+ ++contents_it )
+ {
+ ZyppPkg pkg = tryCastToZyppPkg( *contents_it );
+ ZyppSel sel;
+
+ if ( pkg )
+ sel = selMapper.findZyppSel( pkg );
+
+
+ if ( sel )
+ {
+ switch ( sel->status() )
+ {
+ case S_Install:
+ case S_AutoInstall:
+ case S_Update:
+ case S_AutoUpdate:
+ // Insert the patch contents selectables into a set,
+ // don't immediately sum up their sizes: The same
+ // package could be in more than one patch, but of
+ // course it will be downloaded only once.
+
+ selectablesToInstall.insert( sel );
+ break;
+
+ case S_Del:
+ case S_AutoDel:
+ case S_NoInst:
+ case S_KeepInstalled:
+ case S_Taboo:
+ case S_Protected:
+ break;
+
+ // intentionally omitting 'default' branch so the compiler can
+ // catch unhandled enum states
+ }
+
+ }
+ }
+ }
+ }
+
+ FSize totalSize = 0;
+
+ for ( set<ZyppSel>::iterator it = selectablesToInstall.begin();
+ it != selectablesToInstall.end();
+ ++it )
+ {
+ if ( (*it)->candidateObj() )
+ totalSize += (*it)->candidateObj()->size();
+ }
+
+ // show the download size
+ if ( diskspaceLabel )
+ {
+ diskspaceLabel->setText( totalSize.asString() );
+ }
+}
+
+
+///////////////////////////////////////////////////////////////////
+//
+// getPackageList()
+//
+NCPkgTable * NCPackageSelector::getPackageList()
+{
+ return pkgList;
+}
+
+//
+// Create layout for Online Update
+//
+void NCPackageSelector::createYouLayout( YWidget * selector, NCPkgTable::NCPkgTableType type )
+{
+ // TODO
+}
+
+//
+// Create layout for Package Selector
+//
+void NCPackageSelector::createPkgLayout( YWidget * selector, NCPkgTable::NCPkgTableType type )
+{
+ // the vertical split is the (only) child of the dialog
+ YLayoutBox * split = YUI::widgetFactory()->createVBox( selector );
+
+ YLayoutBox * hSplit = YUI::widgetFactory()->createHBox( split );
+
+ YAlignment * left1 = YUI::widgetFactory()->createLeft( hSplit );
+
+ // label of the filter menu ( keep it short ) - filters out a set of packages
+ filterMenu = new NCMenuButton( left1, _("&Filter") );
+ YUI_CHECK_NEW( filterMenu );
+ filterMenu->setFunctionKey( 4 );
+
+ // begin: menu items of the filter menu
+ // please note: use unique hotkeys until end:
+ groupsItem = new YMenuItem( _("RPM &Groups") );
+ patternsItem = new YMenuItem( _("Pa&tterns") );
+ languagesItem = new YMenuItem( _("&Languages") );
+ reposItem = new YMenuItem( _("&Repositories" ) );
+ searchItem = new YMenuItem( _("&Search" ) );
+ installedItem = new YMenuItem( _( "Installed &Packages" ) );
+ whatifItem = new YMenuItem( _( "&Installation Summary" ) );
+ // end: menu items of the filter menu
+ updatelistItem = new YMenuItem( _( "&Update List" ) );
+
+ YItemCollection itemCollection;
+ itemCollection.push_back( groupsItem );
+ itemCollection.push_back( patternsItem );
+ itemCollection.push_back( languagesItem );
+ itemCollection.push_back( reposItem );
+ itemCollection.push_back( searchItem );
+ itemCollection.push_back( installedItem );
+ itemCollection.push_back( whatifItem );
+ itemCollection.push_back( updatelistItem );
+ filterMenu->addItems( itemCollection );
+
+ YAlignment * left2 = YUI::widgetFactory()->createLeft( hSplit );
+
+ // label Actions menu ( keep it short ) - actions to change status of a package
+ actionMenu = new NCMenuButton( left2, _( "A&ctions" ) );
+ YUI_CHECK_NEW( actionMenu );
+ actionMenu->setFunctionKey( 5 );
+
+ // Please note: add an appropriate number of whitespaces to get a well
+ // formated menu (the [ ]s should be in one column) and use unique hotkeys until end:
+ // begin: Actions menu, toggle the status, e.g. change from installed to delete
+ toggleItem = new YMenuItem( _( "&Toggle [SPACE]" ) );
+ selectItem = new YMenuItem( _( "&Select [+]" ) );
+ deleteItem = new YMenuItem( _( "&Delete [-]" ) );
+ updateItem = new YMenuItem( _( "&Update [>]" ) );
+ tabooItem = new YMenuItem( _( "Taboo &Yes [!]" ) );
+ notabooItem = new YMenuItem( _( "Taboo &No [%]" ) );
+ // end: Actions menu, set status of all packages (title of a submenu)
+ allItem = new YMenuItem( _( "All Listed &Packages" ) );
+
+ YItemCollection itemCollection2;
+ itemCollection2.push_back( toggleItem );
+ itemCollection2.push_back( selectItem );
+ itemCollection2.push_back( deleteItem );
+ itemCollection2.push_back( updateItem );
+ itemCollection2.push_back( tabooItem );
+ itemCollection2.push_back( notabooItem );
+ itemCollection2.push_back( allItem );
+
+ // begin: submenu items actions concerning all packages
+ // please note: use unique hotkeys until end:
+ selallItem = new YMenuItem( allItem, _( "&Install All" ) );
+ deselallItem = new YMenuItem( allItem, _( "Do &Not Install Any" ) );
+ delallItem = new YMenuItem( allItem, _( "&Delete All" ) );
+ dontdelItem = new YMenuItem( allItem, _( "Do Not D&elete Any" ) );
+ updnewerItem = new YMenuItem( allItem, _( "&Update If Newer Version Available" ) );
+ updallItem = new YMenuItem( allItem, _( "U&pdate All Unconditionally") );
+ // end: submenu items: actions concerning all packages
+ dontupdItem = new YMenuItem( allItem, _( "Do Not Update and &Keep Installed" ) );
+
+ actionMenu->addItems( itemCollection2 );
+
+ YAlignment * left3 = YUI::widgetFactory()->createLeft( hSplit );
+
+ // label Information menu ( keep it short! )
+ infoMenu = new NCMenuButton( left3, _( "&Information" ) );
+ YUI_CHECK_NEW( infoMenu );
+ infoMenu->setFunctionKey( 6 );
+
+ // begin: menu items of the info menu
+ // please note: use unique hotkeys until end:
+ pkginfoItem = new YMenuItem( _( "&Package Info" ) );
+ longdescrItem = new YMenuItem( _( "&Long Description" ) );
+ versionsItem = new YMenuItem( _( "&Versions" ) );
+ filesItem = new YMenuItem( _( "&File List" ) );
+ // end: menu items of the info menu
+ relationsItem = new YMenuItem( _( "Package &Relations" ) );
+
+ YItemCollection itemCollection3;
+ itemCollection3.push_back( pkginfoItem );
+ itemCollection3.push_back( longdescrItem );
+ itemCollection3.push_back( versionsItem );
+ itemCollection3.push_back( filesItem );
+ itemCollection3.push_back( relationsItem );
+ infoMenu->addItems( itemCollection3 );
+
+ YAlignment * left4 = YUI::widgetFactory()->createLeft( hSplit );
+
+ // label Etc. menu ( keep it short! )
+ etcMenu = new NCMenuButton( left4, _( "&Etc." ) );
+ YUI_CHECK_NEW( etcMenu );
+ etcMenu->setFunctionKey( 7 );
+ // add items to Etc. menu
+ createEtcMenu();
+
+ // add the package table
+ YTableHeader * tableHeader = new YTableHeader();
+
+ pkgList = new NCPkgTable( split, tableHeader );
+ YUI_CHECK_NEW( pkgList );
+
+ NCPkgStatusStrategy * strategy;
+ // set the table type
+ switch ( type )
+ {
+ case NCPkgTable::T_Patches:
+ strategy = new PatchStatStrategy();
+ pkgList->setTableType( NCPkgTable::T_Patches, strategy );
+ case NCPkgTable::T_Update:
+ strategy = new UpdateStatStrategy();
+ pkgList->setTableType( NCPkgTable::T_Update, strategy );
+ default:
+ strategy = new PackageStatStrategy();
+ pkgList->setTableType( NCPkgTable::T_Packages, strategy );
+ }
+ // set the pointer to the packager object
+ pkgList->setPackager( this );
+
+ // HBox for Filter and Disk Space (both in additional HBoxes )
+ YLayoutBox * hSplit2 = YUI::widgetFactory()->createHBox( split );
+
+ YLayoutBox * hSplit3 = YUI::widgetFactory()->createHBox( hSplit2 );
+ // label text - keep it short
+ new NCLabel( hSplit3, _( "Filter: " ) );
+ filterLabel = YUI::widgetFactory()->createLabel ( hSplit3, "....................................." );
+
+ new NCSpacing( hSplit2, YD_HORIZ, true, 0.5 );
+
+ YLayoutBox * hSplit4 = YUI::widgetFactory()->createHBox( hSplit2 );
+ // label text - keep it short (use abbreviation if necessary)
+ new NCLabel( hSplit4, _( "Required Disk Space: " ) );
+ diskspaceLabel = YUI::widgetFactory()->createLabel ( hSplit4, " " );
+
+ YLayoutBox * vSplit = YUI::widgetFactory()->createVBox( split );
+ replacePoint = YUI::widgetFactory()->createReplacePoint( vSplit );
+
+ infoText = new NCRichText( replacePoint, " " );
+ YUI_CHECK_NEW( infoText );
+
+ YLayoutBox * hSplit5 = YUI::widgetFactory()->createHBox( vSplit );
+
+ // add the Cancel button
+ cancelButton = new NCPushButton( hSplit5, _( "&Cancel" ) );
+ YUI_CHECK_NEW( cancelButton );
+ cancelButton->setFunctionKey( 9 );
+
+ // add the OK button
+ okButton = new NCPushButton( hSplit5, _( "&Accept" ) );
+ YUI_CHECK_NEW( okButton );
+ okButton->setFunctionKey( 10 );
+
+}
+
+void NCPackageSelector::createEtcMenu( )
+{
+ // menu item of the Etc. menu - package dependency check
+ depsItem = new YMenuItem( _( "&Dependencies" ) );
+ // menu items of the Etc./Dependencies submenu
+ showdepsItem = new YMenuItem( depsItem, _( " &Check Dependencies Now" ) );
+ if ( autoCheck )
+ // menu entry: dependency check off
+ autodepsItem = new YMenuItem( depsItem, _( "[X] &Automatic Dependency Check" ) );
+ else
+ // menu entry: dependency check on
+ noautodepsItem = new YMenuItem( depsItem, _( "[ ] &Automatic Dependency Check" ) );
+
+ verifyItem = new YMenuItem( depsItem, _( " &Verify System" ) );
+ // menu item - list of all packages in the system
+ allpksItem = new YMenuItem( _("All &Packages List" ) );
+ exportItem = new YMenuItem( allpksItem, _("&Export to File") );
+ importItem = new YMenuItem( allpksItem, _("&Import from File") );
+ testcaseItem = new YMenuItem( _( "Generate Dependency Resolver &Test Case" ) );
+
+ YItemCollection itemCollection4;
+ itemCollection4.push_back( depsItem );
+ itemCollection4.push_back( allpksItem );
+ itemCollection4.push_back( testcaseItem );
+ etcMenu->addItems( itemCollection4 );
+}
+
+//
+// Fill package list with packages of default RPM group/update list or installable patches
+//
+bool NCPackageSelector::fillDefaultList( )
+{
+ if ( !pkgList )
+ return false;
+
+ // NCMIL << "Fill list: " << (const NCWidget *) pkgList << endl;
+ NCMIL << "Fill list: " << (NCWidget *) pkgList << endl;
+ switch ( pkgList->getTableType() )
+ {
+ case NCPkgTable::T_Patches: {
+ fillPatchList( "installable" ); // default: installable patches
+
+ // set the visible info to long description
+ setVisibleInfo ( longdescrItem );
+
+ // show the package description of the current item
+ pkgList->showInformation ();
+ break;
+ }
+ case NCPkgTable::T_Update: {
+ if ( ! zypp::getZYpp()->resolver()->problematicUpdateItems().empty() )
+ {
+ fillUpdateList();
+ // set the visible info to package description
+ setVisibleInfo ( pkginfoItem );
+ // show the package description of the current item
+ pkgList->showInformation ();
+ break;
+ }
+ }
+ case NCPkgTable::T_Packages: {
+ YStringTreeItem * defaultGroup = getDefaultRpmGroup();
+
+ if ( defaultGroup )
+ {
+ NCMIL << "default RPM group: " << defaultGroup->value().translation() << endl;
+ fillPackageList ( YCPString( defaultGroup->value().translation()),
+ defaultGroup );
+
+ // set the visible info to package description
+ setVisibleInfo ( pkginfoItem );
+ // show the package description of the current item
+ pkgList->showInformation ();
+ }
+ else
+ {
+ NCERR << "No default RPM group available" << endl;
+ }
+ break;
+ }
+ default:
+ break;
+ }
+
+ pkgList->setKeyboardFocus();
+
+ return true;
+}
Added: branches/tmp/bubli/ncurses-pkg/src/NCPackageSelector.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/NCPackageSelector.h?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/src/NCPackageSelector.h (added)
+++ branches/tmp/bubli/ncurses-pkg/src/NCPackageSelector.h Fri Feb 8 13:59:32 2008
@@ -0,0 +1,587 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: NCPackageSelector.h
+
+ Author: Gabriele Strattner
+ Maintainer: Michael Andres
+
+/-*/
+#ifndef NCPackageSelector_h
+#define NCPackageSelector_h
+
+#include <iosfwd>
+#include "Y2Log.h"
+
+#include "YNCursesUI.h"
+#include "NCPkgNames.h"
+
+#include <map>
+#include <string>
+#include <utility> // for STL pair
+
+#include
+#include "YWidgetID.h"
+
+#include
+#include
+#include
+
+#include "NCPkgPopupTree.h"
+#include "NCPkgTable.h"
+#include "NCPkgSelMapper.h"
+
+class NCPkgPopupSelection;
+class NCPkgPopupRepo;
+class LangCode;
+class NCPkgPopupDeps;
+class NCPkgPopupDiskspace;
+class NCPkgPopupSearch;
+class NCPkgPopupFile;
+class NCPushButton;
+class YNCursesUI;
+class NCMenuButton;
+class YReplacePoint;
+
+///////////////////////////////////////////////////////////////////
+//
+// CLASS NAME : NCPackageSelector
+//
+// DESCRIPTION : holds the data and handles events
+//
+class NCPackageSelector
+{
+
+ friend std::ostream & operator<<( std::ostream & STREAM, const NCPackageSelector & OBJ );
+
+ NCPackageSelector & operator=( const NCPackageSelector & );
+ NCPackageSelector ( const NCPackageSelector & );
+
+ private:
+
+ // typedef for the pointer to handler member function
+ typedef bool (NCPackageSelector::* tHandlerFctPtr) ( const NCursesEvent& event );
+
+ // typedef for the internal map: key=nameId, value=handler-fct-ptr
+ typedef std::map tHandlerMap;
+
+ tHandlerMap eventHandlerMap; // event handler map
+
+ YNCursesUI * y2ui; // the UI
+
+ YWidget * widgetRoot; // the root of the widget tree of the layout
+
+ NCPkgPopupTree * filterPopup; // the rpm group tags popup
+
+ NCPkgPopupDeps * depsPopup; // the package dependeny popup
+
+ NCPkgPopupSelection * selectionPopup; // the selections popup
+ NCPkgPopupSelection * patternPopup; // the pattern popup
+ NCPkgPopupSelection * languagePopup; // language popup
+ NCPkgPopupRepo * repoPopup;
+
+ NCPkgPopupDiskspace * diskspacePopup; // the popup showing the disk usage
+
+ NCPkgPopupSearch * searchPopup; // the package search popup
+
+ bool youMode; // YOU
+ bool updateMode; // Update
+ bool testMode; // testing
+
+ bool autoCheck; // flag for automatic dependency check on/off
+ YRpmGroupsTree * _rpmGroupsTree; // rpm groups of the found packages
+
+ // the package table
+ NCPkgTable * pkgList;
+
+ // filter menu and items
+ NCMenuButton * filterMenu;
+ YMenuItem * groupsItem;
+ YMenuItem * patternsItem;
+ YMenuItem * languagesItem;
+ YMenuItem * reposItem;
+ YMenuItem * searchItem;
+ YMenuItem * installedItem;
+ YMenuItem * whatifItem;
+ YMenuItem * updatelistItem;
+
+ // action menu and items
+ NCMenuButton * actionMenu;
+ YMenuItem * toggleItem;
+ YMenuItem * selectItem;
+ YMenuItem * deleteItem;
+ YMenuItem * updateItem;
+ YMenuItem * tabooItem;
+ YMenuItem * notabooItem;
+ YMenuItem * allItem;
+ YMenuItem * selallItem;
+ YMenuItem * delallItem;
+ YMenuItem * deselallItem;
+ YMenuItem * dontdelItem;
+ YMenuItem * updnewerItem;
+ YMenuItem * updallItem;
+ YMenuItem * dontupdItem;
+
+ // information menu and items
+ NCMenuButton * infoMenu;
+ YMenuItem * pkginfoItem;
+ YMenuItem * longdescrItem;
+ YMenuItem * versionsItem;
+ YMenuItem * filesItem;
+ YMenuItem * relationsItem;
+
+ // information menu and items YOU
+ YMenuItem * patchdescrItem;
+ YMenuItem * patchpkgsItem;
+ YMenuItem * pkgversionsItem;
+
+ // etc menu and items
+ NCMenuButton * etcMenu;
+ YMenuItem * depsItem;
+ YMenuItem * showdepsItem;
+ YMenuItem * autodepsItem;
+ YMenuItem * noautodepsItem;
+ YMenuItem * verifyItem;
+ YMenuItem * allpksItem;
+ YMenuItem * exportItem;
+ YMenuItem * importItem ;
+ YMenuItem * testcaseItem;
+
+
+ // labels
+ YLabel * filterLabel;
+ YLabel * diskspaceLabel;
+
+ // information about packages
+ NCRichText * infoText; // short/longdecsription, filelist
+ YReplacePoint * replacePoint; // replace point for info text
+
+ NCPkgTable * versionsList; // list of available package versions
+ // information about patches
+ NCPkgTable * patchPkgs; // pakages belonging to a patch
+ NCPkgTable * patchPkgsVersions; // versions of packages above
+
+ NCPushButton * okButton;
+ NCPushButton * cancelButton;
+
+ YMenuItem * visibleInfo; // current visible package info (description, file list, ...)
+
+ // internal helper functions (format list of string)
+ string createRelLine( const zypp::CapSet & info );
+ // internal use (copies tree items got from YPkgRpmGroupTagsFilterView)
+ void cloneTree( YStringTreeItem * parentOrig, YTreeItem * parentClone );
+
+ // returns the package table widget
+ NCPkgTable * getPackageList();
+
+ // Mapping from ZyppPkg to the correspoinding ZyppSel.
+ NCPkgSelMapper selMapper;
+
+ set<string> verified_pkgs;
+
+ protected:
+
+ string getButtonId( YWidget *button );
+ string getMenuId( YMenuItem *menu );
+
+ public:
+
+ /**
+ * The package selector class handles the events and holds the
+ * data needed for the package selection.
+ * @param ui The NCurses UI
+ * @param opt The widget options
+ */
+ NCPackageSelector( YNCursesUI * ui, YWidget * wRoot, long modeFlags );
+
+ /**
+ * Destructor
+ */
+ virtual ~NCPackageSelector();
+
+ /**
+ * Create all NCPkgPopus
+ * @return void
+ */
+ void createPopups();
+
+ /**
+ * Create layout for the PackageSelector
+ * @param parent Parent is PackageSelectorStart
+ * @param type The package table type
+ * @return void
+ */
+ void createPkgLayout( YWidget * parent, NCPkgTable::NCPkgTableType type );
+ void createEtcMenu();
+
+ /**
+ * Create layout for the Online Update
+ * @param parent Parent is PackageSelectorStart
+ * @param type The package table type
+ * @return void
+ */
+ void createYouLayout( YWidget * parent, NCPkgTable::NCPkgTableType type );
+
+
+ /**
+ * Fills the package table
+ * @param label The selected RPM group (the label)
+ * @param group The rpm group
+ * @return bool
+ */
+ bool fillPackageList( const YCPString & label, YStringTreeItem * group );
+
+
+ /**
+ * Fills the package table with YOU patches matching the filter
+ * @param filter
+ * @return bool
+ */
+ bool fillPatchList( string filter );
+
+ /**
+ * Fills the package table with packages with update problems
+ * @return bool
+ */
+ bool fillUpdateList( );
+
+ /**
+ * Fills the package table with a summary packages
+ * @return bool
+ */
+ bool fillSummaryList( NCPkgTable::NCPkgTableListType type );
+
+ /**
+ * Fills the list of available packages
+ * @param table The table widget
+ * @param selectable Show all available versions of this package
+ * @return bool
+ */
+ bool fillAvailableList( NCPkgTable *table, ZyppSel selectable );
+
+ /**
+ * Fills the list of packages belonging to the youPatch
+ * @param pkgTable The table widget
+ * @param youPatch Show all packages belonging to the patch
+ * @param versions Show all versions of all packages belonging to the patch
+ * @return bool
+ */
+ bool fillPatchPackages ( NCPkgTable * pkgTable, ZyppObj youPatch, bool versions = false );
+
+ /**
+ * Fills the package table with packages matching the search expression
+ * @param expr The search expression
+ * @param ignoreCase Ignore case (true or false)
+ * @param checkName Search in package name (true or false)
+ * @param checkSummary Check the summary (true or false)
+ * @param checkProvides Check in Provides (true or false)
+ * @param checkRequires Check in Requires (true or false)
+ * @return bool
+ */
+ bool fillSearchList( const string & expr,
+ bool ignoreCase,
+ bool checkName,
+ bool checkSummary,
+ bool checkDescr,
+ bool checkProvides,
+ bool checkRequires );
+
+ bool fillPatchSearchList( const string & expr );
+
+ bool fillDefaultList();
+
+ /**
+ *Fills the package table with packages from selected repository
+ *@param repo zypp::Repository
+ */
+ bool fillRepoFilterList ( ZyppRepo repo );
+
+ bool isYouMode() { return youMode; }
+ /**
+ * Gets default RPM group (the first group)
+ * @return YStringTreeItem *
+ */
+ YStringTreeItem * getDefaultRpmGroup();
+
+ /**
+ * @return the rpm groups
+ */
+ const YRpmGroupsTree * rpmGroupsTree () const { return _rpmGroupsTree; }
+
+ /**
+ * Handle the given event. For the given event (the widget-id
+ * is contained in the event) the corresponding handler is executed.
+ * @param event The NCurses event
+ * @return bool
+ */
+ bool handleEvent( const NCursesEvent& event );
+
+ /**
+ * Handler function for "Search button pressed"
+ * @param event The Ncurses event
+ * @return bool
+ */
+ bool SearchHandler ( const NCursesEvent& event );
+
+ /**
+ * Handler function for menu selection "Etc./Check dependencies"
+ * @param event The Ncurses event
+ * @return bool
+ */
+ bool DependencyHandler( const NCursesEvent& event );
+
+ /**
+ * Handler function for the "Information" menu
+ * @param event The Ncurses event
+ * @return bool
+ */
+ bool InformationHandler ( const NCursesEvent& event );
+
+ /**
+ * Generate test case /var/log/YaST2/solverTestcase
+ * @return bool
+ */
+ bool TestcaseHandler ( const NCursesEvent& event );
+
+ /**
+ * Export/Import list of all packages and patterns to/from file
+ *
+ */
+ bool FileHandler ( const NCursesEvent& event );
+
+ /**
+ * Handler function for "OK button pressed"
+ * @param event The Ncurses event
+ * @return bool
+ */
+ bool OkButtonHandler ( const NCursesEvent& event );
+
+ /**
+ * Handler function for "Cancel button pressed"
+ * @param event The Ncurses event
+ * @return bool
+ */
+ bool CancelHandler ( const NCursesEvent& event );
+
+ /**
+ * Handler function for "Diskspace button pressed"
+ * @param event The Ncurses event
+ * @return bool
+ */
+ bool DiskinfoHandler ( const NCursesEvent& event );
+
+ /**
+ * Handler function for the "Filter" menu
+ * @param event The Ncurses event
+ * @return bool
+ */
+ bool FilterHandler( const NCursesEvent& event );
+
+ /**
+ * Handler function for the "Action" menu (changes the package status)
+ * @param event The Ncurses event
+ * @return bool
+ */
+ bool StatusHandler( const NCursesEvent& event );
+
+ /**
+ * Handler function for the "Help" menu
+ * @param event The Ncurses event
+ * @return bool
+ */
+ bool HelpHandler( const NCursesEvent& event );
+
+ /**
+ * Handler function for the "Help" button in YOU
+ * @param event The Ncurses event
+ * @return bool
+ */
+ bool YouHelpHandler( const NCursesEvent& event );
+
+ /**
+ * Handles hyperlinks in package description
+ * @param link The link
+ * @return bool
+ */
+ bool LinkHandler ( string link );
+
+ /**
+ * Gets the required package info from package manager and shows it
+ * ( called from NCPkgTable )
+ * @param pkgPtr the data pointer
+ * @return bool
+ */
+ bool showPackageInformation ( ZyppObj pkgPtr, ZyppSel slbPtr );
+
+ /**
+ * Checks and shows the dependencies
+ * @param doit true: do the check, false: only check if auto check is on
+ */
+ bool showPackageDependencies ( bool doit );
+
+ /**
+ * Verifies and shows the dependencies
+ */
+ bool verifyPackageDependencies ();
+
+ /**
+ * Checks and shows the selectiondependencies
+ */
+ void showSelectionDependencies ( );
+
+
+ /**
+ * Gets the required patch info from you patch manager and shows it
+ * @param pkgPtr the data pointer
+ * @return bool
+ */
+ bool showPatchInformation ( ZyppObj pkgPtr, ZyppSel slbPtr );
+
+
+ /**
+ * Sets the member variable to the currently visible information
+ * @param info
+ */
+ void setVisibleInfo( YMenuItem * info );
+
+ /**
+ * Fills the package table
+ * @param label The selected selection (the label)
+ * @param wanted which packages
+ * @return bool
+ */
+ bool showSelPackages( const YCPString & label, const set<string> & wanted );
+
+ /**
+ * Updates the status in list of packages
+ */
+ void updatePackageList();
+
+ /**
+ * Check if 'pkg' matches 'selectedRpmGroup'.
+ * Returns true if there is a match, false otherwise or if 'pkg' is 0.
+ * @return bool
+ **/
+ bool checkPackage( ZyppObj pkg, ZyppSel slb, YStringTreeItem * rpmGroup );
+
+ /**
+ * Check if 'patch' matches the selected filter.
+ * Returns true if there is a match, false otherwise or if 'patch' is 0.
+ * @return bool
+ **/
+ bool checkPatch( ZyppPatch patch, ZyppSel selectable, string filter );
+
+ /**
+ * Set status of a selectable according to its presence
+ * in the list imported from xml file (zypp::syscontent::Reader)
+ *
+ * @param selectable a selectable
+ * @param isWanted should be installed or not
+ * @param kind "package" or "pattern"
+ * @return void
+ **/
+ void importSelectable ( ZyppSel selectable, bool isWanted, const char* kind );
+
+ /**
+ * Returns whether automatic dependency is on or off
+ * @return bool
+ */
+ bool autoChecking() { return autoCheck; }
+
+ /**
+ * Creates a text from a list of strings
+ * @param oneline true: create one line, items seperated by comma; false: every string is a line
+ * @return string The text
+ */
+ string createText( list<string> info, bool oneline );
+
+ /**
+ * Creates a text from a list of strings which may contain HTML tags
+ * @param t used to be list, now a single string. but what does it contain?
+ * @return string The text
+ */
+ string createDescrText( zypp::Text t );
+
+ /**
+ * Used for package search
+ * @param s1 Search in s1
+ * @param s2 Searching for s2
+ * @return bool
+ */
+ bool match( string s1, string s2, bool ignoreCase );
+
+ /**
+ * Calls the package mananager (updateDu()) and shows the required disk space
+ */
+ void showDiskSpace();
+
+ /**
+ * Shows the total download size
+ */
+ void showDownloadSize();
+
+ /**
+ * Check for changes
+ */
+ void saveState();
+ void restoreState();
+ bool diffState();
+
+ /**
+ * Check for license
+ */
+ bool showPendingLicenseAgreements();
+ bool showPendingLicenseAgreements( ZyppPoolIterator begin, ZyppPoolIterator end );
+
+ /**
+ * Show popup with license.
+ * @return bool
+ */
+ bool showLicenseAgreement( ZyppSel & slbPtr , string licenseText );
+
+ void createFilterMenu();
+
+ /**
+ * Get list of packages already selected for automatic changes
+ * (usually via 'verify system' call)
+ * @return std::set <string>
+ */
+ set <string> getVerifiedPkgs()
+ {
+ return verified_pkgs;
+ }
+
+ /**
+ * Insert package name into the list of already selected for automatic changes
+ * @param pkgname Package name
+ */
+ void insertVerifiedPkg( string pkgname ) {
+ verified_pkgs.insert( pkgname);
+ }
+
+ /**
+ * Empty the set of packages selected for automatic changes
+ * @return void
+ */
+ void clearVerifiedPkgs() {
+ if ( !verified_pkgs.empty() )
+ {
+ NCMIL << "Discarding auto-dependency changes" << endl;
+ verified_pkgs.clear();
+ }
+ }
+
+};
+
+///////////////////////////////////////////////////////////////////
+
+#endif // NCPackageSelector_h
Added: branches/tmp/bubli/ncurses-pkg/src/NCPackageSelectorPluginImpl.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/NCPackageSelectorPluginImpl.cc?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/src/NCPackageSelectorPluginImpl.cc (added)
+++ branches/tmp/bubli/ncurses-pkg/src/NCPackageSelectorPluginImpl.cc Fri Feb 8 13:59:32 2008
@@ -0,0 +1,183 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (c) SuSE Linux AG |
+\----------------------------------------------------------------------/
+
+ File: NCPackageSelectorPluginImpl.cc
+
+ Author: Hedgehog Painter
+ \\\'>
+
+/-*/
+
+#include "NCPackageSelectorPluginImpl.h"
+#include "NCPackageSelectorStart.h"
+
+#include
+#include
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPackageSelectorPluginStub::createPackageSelector
+// METHOD TYPE : YWidget
+//
+// DESCRIPTION : Create NCPackageSelectorStart which reads the layout
+// term of the package selection dialog, creates the widget
+// tree and creates the NCPackageSelector.
+//
+NCPackageSelectorPluginImpl PSP;
+
+YPackageSelector * NCPackageSelectorPluginImpl::createPackageSelector( YWidget * parent,
+ long modeFlags )
+{
+ YWidget * w = 0;
+
+ try
+ {
+ w = new NCPackageSelectorStart ( parent, modeFlags, YD_HORIZ );
+ }
+ catch (const std::exception & e)
+ {
+ UIERR << "Caught a std::exception: " << e.what () << endl;
+ }
+ catch (...)
+ {
+ UIERR << "Caught an unspecified exception" << endl;
+ }
+
+ // FIXME - remove debug logging
+ YDialog::currentDialog()->dumpWidgetTree();
+ NCWidget * firstChild = dynamic_cast(YDialog::currentDialog()->firstChild());
+ if ( firstChild )
+ NCMIL << "FIRST child: " << firstChild << endl;
+ NCMIL << "Selector: " << w << endl;
+ // FIXME ???
+ return (YPackageSelector *)(w);
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPackageSelectorPluign::createPkgSpecial
+// METHOD TYPE : YWidget
+//
+// DESCRIPTION : creates special widgets used for the package selection
+// dialog (which do not have a corresponding widget in qt-ui)
+//
+YWidget * NCPackageSelectorPluginImpl::createPkgSpecial( YWidget *parent, const string &subwidget )
+{
+ YWidget * w = 0;
+ YTableHeader * tableHeader = new YTableHeader();
+
+ if ( subwidget == "pkgTable" )
+ {
+ NCDBG << "Creating a NCPkgTable" << endl;
+ try
+ {
+ //UIERR << "Tady taky nic neni " << endl;
+ w = new NCPkgTable( parent, tableHeader );
+ }
+ catch (const std::exception & e)
+ {
+ UIERR << "Caught a std::exception: " << e.what () << endl;
+ }
+ catch (...)
+ {
+ UIERR << "Caught an unspecified exception" << endl;
+ }
+ }
+ else
+ {
+ NCERR << "PkgSpecial( " << subwidget << " ) not found - take default `Label" << endl;
+ w = new NCLabel( parent, subwidget, false, false );
+ }
+
+ return w;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPackageSelectorPLugin::runPkgSelection
+// METHOD TYPE : YEvent *
+//
+// DESCRIPTION : Implementation of UI builtin RunPkgSelection() which
+// has to be called after OpenDialog( `PackageSelector() ).
+//
+YEvent * NCPackageSelectorPluginImpl::runPkgSelection( YDialog * dialog,
+ YWidget * selector )
+{
+ NCPackageSelectorStart * ncSelector = 0;
+
+ NCMIL << "Calling runPkgSelection()" << endl;
+
+ if ( !dialog )
+ {
+ UIERR << "ERROR package selection: No dialog existing." << endl;
+ return 0;
+ }
+ if ( !selector )
+ {
+ UIERR << "ERROR package selection: No package selector existing." << endl;
+ return 0;
+ }
+
+ ncSelector = dynamic_cast( selector );
+
+ bool result = true;
+
+ // start event loop
+ NCursesEvent event = NCursesEvent::cancel;
+ NCDialog * ncd = static_cast( dialog );
+
+ if ( ncSelector )
+ {
+ try
+ {
+ ncSelector->showDefaultList();
+ NCMIL << "NCDialog: " << ncd << endl;
+ do
+ {
+ event = ncd->userInput();
+ result = ncSelector->handleEvent( event );
+ NCDBG << "Result: " << (result?"true":"false") << endl;
+ }
+ while ( event != NCursesEvent::cancel && result == true );
+ }
+ catch (const std::exception & e)
+ {
+ UIERR << "Caught a std::exception: " << e.what () << endl;
+ }
+ catch (...)
+ {
+ UIERR << "Caught an unspecified exception" << endl;
+ }
+ }
+ else
+ {
+ UIERR << "No NCPackageSelectorStart existing" << endl;
+ }
+
+ if ( event.result != "" )
+ {
+ // Before returning some value to the YCP client,
+ // we must delete (==close) any leftover dialogs,
+ // Wizard will not do it for us (#354712)
+ while( YDialog::topmostDialog() != dialog ) {
+ YDialog::deleteTopmostDialog();
+ }
+ NCMIL << "Return value: " << event.result << endl;
+ return new YMenuEvent( event.result );
+ }
+ else
+ return new YCancelEvent();
+}
+
Added: branches/tmp/bubli/ncurses-pkg/src/NCPackageSelectorPluginImpl.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/NCPackageSelectorPluginImpl.h?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/src/NCPackageSelectorPluginImpl.h (added)
+++ branches/tmp/bubli/ncurses-pkg/src/NCPackageSelectorPluginImpl.h Fri Feb 8 13:59:32 2008
@@ -0,0 +1,39 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (c) SuSE Linux AG |
+\----------------------------------------------------------------------/
+
+ File: NCPackageSelectorPluginImpl.h
+
+ Author: Hedgehog Painter
+
+
+/-*/
+
+#ifndef NCPackageSelectorPluginImpl_h
+#define NCPackageSelectorPluginImpl_h
+
+#include "NCPackageSelectorPluginIf.h"
+
+class NCPackageSelectorPluginImpl : public NCPackageSelectorPluginIf
+{
+
+ public:
+
+ virtual ~NCPackageSelectorPluginImpl() {};
+
+ virtual YPackageSelector * createPackageSelector( YWidget * parent, long modeFlags);
+
+ virtual YEvent *runPkgSelection (YDialog *currentDialog, YWidget *packageSelector );
+
+ virtual YWidget *createPkgSpecial (YWidget *parent, const string &subwidget );
+
+};
+#endif
Added: branches/tmp/bubli/ncurses-pkg/src/NCPackageSelectorStart.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/NCPackageSelectorStart.cc?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/src/NCPackageSelectorStart.cc (added)
+++ branches/tmp/bubli/ncurses-pkg/src/NCPackageSelectorStart.cc Fri Feb 8 13:59:32 2008
@@ -0,0 +1,176 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: NCPackageSelectorStart.cc
+
+ Author: Gabriele Strattner
+ Maintainer: Michael Andres
+
+/-*/
+#include "Y2Log.h"
+#include "NCurses.h"
+#include "NCPackageSelectorStart.h"
+#include "NCPushButton.h"
+#include "NCSpacing.h"
+#include "NCPkgTable.h"
+#include "NCLabel.h"
+#include "NCPkgNames.h"
+#include "NCi18n.h"
+
+#include
+
+#include
+#include
+#include
+
+#include "YPackageSelector.h"
+#include "YCPDialogParser.h"
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPackageSelectorStart::NCPackageSelectorStart
+// METHOD TYPE : Constructor
+//
+// DESCRIPTION :
+//
+NCPackageSelectorStart::NCPackageSelectorStart( YWidget * parent,
+ long modeFlags,
+ YUIDimension dimension )
+ : NCLayoutBox( parent, dimension )
+ , widgetRoot( 0 )
+ , packager( 0 )
+ , youMode ( false )
+ , updateMode ( false )
+{
+ YNCursesUI * ui = YNCursesUI::ui();
+
+ // set the textdomain
+ setTextdomain( "packages" );
+
+ // get the mode (the mode is also available in PackageSelector via modeFlags)
+ if ( modeFlags & YPkg_OnlineUpdateMode )
+ youMode = true;
+
+ if ( modeFlags & YPkg_UpdateMode )
+ updateMode = true;
+
+ // NEW NEW
+ packager = new NCPackageSelector( ui, widgetRoot, modeFlags );
+
+ NCPkgTable::NCPkgTableType type;
+
+ if ( youMode )
+ type = NCPkgTable::T_Patches;
+ else if ( updateMode )
+ type = NCPkgTable::T_Update;
+ else
+ type = NCPkgTable::T_Packages;
+
+ if ( packager )
+ {
+ if ( !youMode )
+ packager->createPkgLayout( this, type );
+ else
+ packager->createYouLayout( this, type );
+ }
+
+ WIDDBG << endl;
+ wstate = NC::WSdumb;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPackageSelectorStart::~NCPackageSelectorStart
+// METHOD TYPE : Destructor
+//
+// DESCRIPTION :
+//
+NCPackageSelectorStart::~NCPackageSelectorStart()
+{
+ if ( packager )
+ {
+ delete packager;
+ }
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPackageSelectorStart::setSize
+// METHOD TYPE : void
+//
+// DESCRIPTION :
+//
+void NCPackageSelectorStart::setSize( int newwidth, int newheight )
+{
+ wRelocate( wpos( 0 ), wsze( newheight, newwidth ) );
+ YLayoutBox::setSize( newwidth, newheight );
+}
+
+
+///////////////////////////////////////////////////////////////////
+//
+// METHOD NAME : NCPackageSelectorStart::showDefaultList
+// METHOD TYPE : void
+//
+// DESCRIPTION : fill up the package table with default data
+//
+//
+void NCPackageSelectorStart::showDefaultList()
+{
+ // fill the package table with packages belonging to the default filter
+
+ if ( packager )
+ {
+ // create the NCPkgPoups
+ packager->createPopups();
+ // fill package list with packages belonging to default RPM group
+ packager->fillDefaultList();
+
+ // always do an initial dependency solving
+ packager->showPackageDependencies( true );
+
+ if ( youMode )
+ {
+ // show download size
+ packager->showDownloadSize();
+ }
+ else
+ {
+ // show the required diskspace
+ packager->showDiskSpace();
+ // FIXME - show appropriate filter menu entries (with patterns or selections)
+ // This may be obsolete if selections are surely obsolete
+ // packager->createFilterMenu();
+ }
+ }
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// METHOD NAME : NCPackageSelectorStart::handleEvent
+// METHOD TYPE : bool
+//
+// DESCRIPTION : passes the event to the handleEvent method
+// of the member variable PackageSelector packager
+//
+bool NCPackageSelectorStart::handleEvent ( const NCursesEvent & event )
+{
+ if ( !packager )
+ return false;
+
+ return packager->handleEvent( event );
+}
+
+
Added: branches/tmp/bubli/ncurses-pkg/src/NCPackageSelectorStart.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/NCPackageSelectorStart.h?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/src/NCPackageSelectorStart.h (added)
+++ branches/tmp/bubli/ncurses-pkg/src/NCPackageSelectorStart.h Fri Feb 8 13:59:32 2008
@@ -0,0 +1,112 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: NCPackageSelectorStart.h
+
+ Author: Gabriele Strattner
+ Maintainer: Michael Andres
+
+/-*/
+#ifndef NCPackageSelectorStart_h
+#define NCPackageSelectorStart_h
+
+#include <iosfwd>
+
+#include "YNCursesUI.h"
+#include "YPackageSelector.h"
+#include "YLayoutBox.h"
+#include "NCLayoutBox.h"
+#include "NCPackageSelector.h"
+#include "NCPopupTable.h"
+
+
+class NCPkgTable;
+class NCPackageSelector;
+class NCPushButton;
+
+/**
+ * @short the package selector widget
+ */
+class NCPackageSelectorStart : public NCLayoutBox
+{
+
+ friend std::ostream & operator<<( std::ostream & STREAM, const NCPackageSelectorStart & OBJ );
+
+ NCPackageSelectorStart & operator=( const NCPackageSelectorStart & );
+ NCPackageSelectorStart ( const NCPackageSelectorStart & );
+
+ private:
+
+ YWidget * widgetRoot; // root of the widget tree of the package selection dialog
+
+ NCPackageSelector *packager; // packager object contains the data and handles events
+
+ bool youMode;
+ bool updateMode;
+
+ protected:
+
+ virtual const char * location() const {
+ return primary() == YD_HORIZ ? "NC(H)PackageSelectorStart" : "NC(V)PackageSelectorStart" ;
+ }
+
+ public:
+
+ /**
+ * Constructor
+ * creates the widget tree of the package selector
+ */
+ NCPackageSelectorStart( YWidget * parent,
+ long modeFlags,
+ YUIDimension dimension );
+
+ /**
+ * Destructor
+ */
+ virtual ~NCPackageSelectorStart();
+
+ virtual int preferredWidth() { return NCLayoutBox::preferredWidth(); }
+ virtual int preferredHeight() { return NCLayoutBox::preferredHeight(); }
+
+ /**
+ * Set the new size of the widget.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual void setSize( int newWidth, int newHeight );
+
+ /**
+ * Fills the package table with packages belonging to the
+ * default filter (the filter which is selected when entering the
+ * package selection).
+ **/
+ void showDefaultList();
+
+ /**
+ * Pass the event to the handleEvent method of the member variable
+ * NCPackageSelector packager.
+ * @param event The NCursesEvent
+ * @return bool
+ */
+ bool handleEvent( const NCursesEvent& event );
+
+ /**
+ * Returns the root of the widget tree.
+ */
+ YWidget * root( ) const { return widgetRoot; };
+
+
+};
+
+///////////////////////////////////////////////////////////////////
+
+#endif // NCPackageSelectorStart_h
Added: branches/tmp/bubli/ncurses-pkg/src/NCPkgNames.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/NCPkgNames.cc?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/src/NCPkgNames.cc (added)
+++ branches/tmp/bubli/ncurses-pkg/src/NCPkgNames.cc Fri Feb 8 13:59:32 2008
@@ -0,0 +1,1855 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: NCPkgNames.cc
+
+ Author: Gabriele Strattner
+ Maintainer: Michael Andres
+
+/-*/
+
+#include
+#include
+#include
+
+#include "NCPkgNames.h"
+
+#include "NCi18n.h"
+
+#include
+
+
+/*
+ Textdomain "packages"
+*/
+
+//
+// Creates the id_name (with ` at the beginning), e.g. `id(`id_name)
+//
+YCPValue NCPkgNames::createIdValue ( const std::string &name )
+{
+ YCPTerm id( name );
+ return YCPString (id->name());
+}
+
+//
+// All `id s used in pkg_layout.ycp
+//
+
+// the package table ( list of packages )
+const YCPValue& NCPkgNames::Packages ()
+{
+ static const YCPValue value = createIdValue ( "packages" );
+ return value;
+}
+
+// the list of available packages
+const YCPValue& NCPkgNames::AvailPkgs ()
+{
+ static const YCPValue value = createIdValue ( "availpkgs" );
+ return value;
+}
+
+// the list of patch packages
+const YCPValue& NCPkgNames::PatchPkgs ()
+{
+ static const YCPValue value = createIdValue ( "patchpkgs" );
+ return value;
+}
+
+const YCPValue& NCPkgNames::PatchPkgsVersions ()
+{
+ static const YCPValue value = createIdValue ( "pkgsversions" );
+ return value;
+}
+
+// the description section ( shown on bottom of the selection dialog )
+const YCPValue& NCPkgNames::Description ()
+{
+ static const YCPValue value = createIdValue ( "description" );
+ return value;
+}
+
+// the file list information ( shown on bottom of the selection dialog )
+const YCPValue& NCPkgNames::FilelistId ()
+{
+ static const YCPValue value = createIdValue ( "filelist" );
+ return value;
+}
+
+// widget id of the ReplacePoint package information
+const YCPValue& NCPkgNames::ReplPoint ()
+{
+ static const YCPValue value = createIdValue ( "replaceinfo" );
+ return value;
+}
+
+// the menu entry Action/Toggle
+const YCPValue& NCPkgNames::Toggle ()
+{
+ static const YCPValue value = createIdValue ( "toggle" );
+ return value;
+}
+
+// the menu entry Action/Select
+const YCPValue& NCPkgNames::Select ()
+{
+ static const YCPValue value = createIdValue ( "select" );
+ return value;
+}
+
+// the menu entry Action/delete
+const YCPValue& NCPkgNames::Delete ()
+{
+ static const YCPValue value = createIdValue ( "delete" );
+ return value;
+}
+
+// the menu entry Action/update
+const YCPValue& NCPkgNames::Update ()
+{
+ static const YCPValue value = createIdValue ( "update" );
+ return value;
+}
+
+// the menu entry Action/update if newer version available
+const YCPValue& NCPkgNames::UpdateNewer ()
+{
+ static const YCPValue value = createIdValue ( "updnewer" );
+ return value;
+}
+
+// the menu entry Action/update all
+const YCPValue& NCPkgNames::UpdateAll ()
+{
+ static const YCPValue value = createIdValue ( "updall" );
+ return value;
+}
+
+// the menu entry Action/do not update all
+const YCPValue& NCPkgNames::DontUpdate ()
+{
+ static const YCPValue value = createIdValue ( "dontupd" );
+ return value;
+}
+
+// the menu entry Action/select all
+const YCPValue& NCPkgNames::InstallAll ()
+{
+ static const YCPValue value = createIdValue ( "selall" );
+ return value;
+}
+// the menu entry Action/deselect all
+const YCPValue& NCPkgNames::DontInstall ()
+{
+ static const YCPValue value = createIdValue ( "deselall" );
+ return value;
+}
+
+// the menu entry Action/delete all
+const YCPValue& NCPkgNames::DeleteAll ()
+{
+ static const YCPValue value = createIdValue ( "delall" );
+ return value;
+}
+
+// the menu entry Action/delete all
+const YCPValue& NCPkgNames::DontDelete ()
+{
+ static const YCPValue value = createIdValue ( "dontdel" );
+ return value;
+}
+// the menu entry Action/Taboo On
+const YCPValue& NCPkgNames::TabooOn ()
+{
+ static const YCPValue value = createIdValue ( "tabooOn" );
+ return value;
+}
+
+// the menu entry Action/Taboo Off
+const YCPValue& NCPkgNames::TabooOff ()
+{
+ static const YCPValue value = createIdValue ( "tabooOff" );
+ return value;
+}
+
+// the menu entry Action/SPM yes/no
+const YCPValue& NCPkgNames::SourceYes ()
+{
+ static const YCPValue value = createIdValue ( "sourceYes" );
+ return value;
+}
+// the menu entry Action/SPM yes/no
+const YCPValue& NCPkgNames::SourceNo ()
+{
+ static const YCPValue value = createIdValue ( "sourceNo" );
+ return value;
+}
+
+// the menu entry Etc./check dep
+const YCPValue& NCPkgNames::ShowDeps ()
+{
+ static const YCPValue value = createIdValue ( "showdeps" );
+ return value;
+}
+// the menu entry Etc./verify system
+const YCPValue& NCPkgNames::VerifySystem ()
+{
+ static const YCPValue value = createIdValue ( "verifysystem" );
+ return value;
+}
+// the menu entry Etc./auto check dep
+const YCPValue& NCPkgNames::AutoDeps ()
+{
+ static const YCPValue value = createIdValue ( "autodeps" );
+ return value;
+}
+
+// the menu entry Etc./Package list/Export to file
+const YCPValue& NCPkgNames::ExportToFile ()
+{
+ static const YCPValue value = createIdValue ( "export" );
+ return value;
+}
+
+// the menu entry Etc./Package list/Import from file
+const YCPValue& NCPkgNames::ImportFromFile ()
+{
+ static const YCPValue value = createIdValue ("import");
+ return value;
+}
+
+// the menu entry Etc./Save selection
+const YCPValue& NCPkgNames::SaveSel ()
+{
+ static const YCPValue value = createIdValue ( "save" );
+ return value;
+}
+
+// the menu entry Etc./Load
+const YCPValue& NCPkgNames::LoadSel ()
+{
+ static const YCPValue value = createIdValue ( "load" );
+ return value;
+}
+
+// internal use
+const YCPValue& NCPkgNames::ReplaceMenu ()
+{
+ static const YCPValue value = createIdValue ( "replacemenu" );
+ return value;
+}
+// internal use
+const YCPValue& NCPkgNames::ReplaceFilter ()
+{
+ static const YCPValue value = createIdValue ( "replacefilter" );
+ return value;
+}
+
+// the search button
+const YCPValue& NCPkgNames::Search ()
+{
+ static const YCPValue value = createIdValue ( "search" );
+ return value;
+}
+
+// menu selection RPM groups
+const YCPValue& NCPkgNames::RpmGroups ()
+{
+ static const YCPValue value = createIdValue ( "groups" );
+ return value;
+}
+
+// menu selection Selections
+const YCPValue& NCPkgNames::Selections ()
+{
+ static const YCPValue value = createIdValue ( "selections" );
+ return value;
+}
+
+// menu selection Patterns
+const YCPValue& NCPkgNames::Patterns ()
+{
+ static const YCPValue value = createIdValue ( "patterns" );
+ return value;
+}
+
+// menu selection Languages
+const YCPValue& NCPkgNames::Languages ()
+{
+ static const YCPValue value = createIdValue ( "languages" );
+ return value;
+}
+
+const YCPValue& NCPkgNames::Repositories ()
+{
+ static const YCPValue value = createIdValue ( "repos");
+ return value;
+}
+
+// menu selection Installation Summary
+const YCPValue& NCPkgNames::Whatif ()
+{
+ static const YCPValue value = createIdValue ( "whatif" );
+ return value;
+}
+
+// menu selection Installed Packages
+const YCPValue& NCPkgNames::Installed ()
+{
+ static const YCPValue value = createIdValue ( "installed" );
+ return value;
+}
+
+// menu selection update list
+const YCPValue& NCPkgNames::UpdateList ()
+{
+ static const YCPValue value = createIdValue ( "updatelist" );
+ return value;
+}
+
+// menu selection long description
+const YCPValue& NCPkgNames::LongDescr ()
+{
+ static const YCPValue value = createIdValue ( "longdescr" );
+ return value;
+}
+
+// menu selection all package versions
+const YCPValue& NCPkgNames::Versions ()
+{
+ static const YCPValue value = createIdValue ( "versions" );
+ return value;
+}
+
+// menu selection file list
+const YCPValue& NCPkgNames::Files ()
+{
+ static const YCPValue value = createIdValue ( "files" );
+ return value;
+}
+
+// menu selection relations
+const YCPValue& NCPkgNames::Relations ()
+{
+ static const YCPValue value = createIdValue ( "relations" );
+ return value;
+}
+
+// menu selection help/update
+const YCPValue& NCPkgNames::UpdateHelp ()
+{
+ static const YCPValue value = createIdValue ( "help_update" );
+ return value;
+}
+
+// menu selection help/search
+const YCPValue& NCPkgNames::SearchHelp ()
+{
+ static const YCPValue value = createIdValue ( "help_search" );
+ return value;
+}
+
+// menu selection package info
+const YCPValue& NCPkgNames::PkgInfo ()
+{
+ static const YCPValue value = createIdValue ( "pkginfo" );
+ return value;
+}
+
+// id of the label which shows the selected filter
+const YCPValue& NCPkgNames::Filter ()
+{
+ static const YCPValue value = createIdValue ( "filter" );
+ return value;
+}
+
+// the label for disk space
+const YCPValue& NCPkgNames::Diskspace ()
+{
+ static const YCPValue value = createIdValue ( "diskspace" );
+ return value;
+}
+
+// the button disk space information
+const YCPValue& NCPkgNames::Diskinfo ()
+{
+ static const YCPValue value = createIdValue ( "diskinfo" );
+ return value;
+}
+
+// cancel button id
+const YCPValue& NCPkgNames::Cancel ()
+{
+ static const YCPValue value = createIdValue ( "cancel" );
+ return value;
+}
+
+// solve button id
+const YCPValue& NCPkgNames::Solve ()
+{
+ static const YCPValue value = createIdValue ( "solve" );
+ return value;
+}
+
+// ignore button id
+const YCPValue& NCPkgNames::Ignore ()
+{
+ static const YCPValue value = createIdValue ( "ignore" );
+ return value;
+}
+
+// ignore button id
+const YCPValue& NCPkgNames::IgnoreAll ()
+{
+ static const YCPValue value = createIdValue ( "ignore_all" );
+ return value;
+}
+
+// combo box id
+const YCPValue& NCPkgNames::SearchBox ()
+{
+ static const YCPValue value = createIdValue ( "search_box" );
+ return value;
+}
+
+// ok button id
+const YCPValue& NCPkgNames::OkButton ()
+{
+ static const YCPValue value = createIdValue ( "ok" );
+ return value;
+}
+
+// id general help
+const YCPValue& NCPkgNames::GeneralHelp ()
+{
+ static const YCPValue value = createIdValue ( "help_general" );
+ return value;
+}
+
+// id help on status
+const YCPValue& NCPkgNames::StatusHelp ()
+{
+ static const YCPValue value = createIdValue ( "help_status" );
+ return value;
+}
+
+// id help on filter
+const YCPValue& NCPkgNames::FilterHelp ()
+{
+ static const YCPValue value = createIdValue ( "help_filter" );
+ return value;
+}
+
+
+//
+// id's used in you_layout.ycp
+//
+
+// id help in YOU mode
+const YCPValue& NCPkgNames::PatchHelp ()
+{
+ static const YCPValue value = createIdValue ( "youhelp" );
+ return value;
+}
+
+// id filter/recommended
+const YCPValue& NCPkgNames::Recommended ()
+{
+ static const YCPValue value = createIdValue ( "recommended" );
+ return value;
+}
+
+// id filter/security
+const YCPValue& NCPkgNames::Security ()
+{
+ static const YCPValue value = createIdValue ( "security" );
+ return value;
+}
+
+// id filter installed
+const YCPValue& NCPkgNames::InstalledPatches ()
+{
+ static const YCPValue value = createIdValue ( "instpatches" );
+ return value;
+}
+
+// id filter installable
+const YCPValue& NCPkgNames::InstallablePatches ()
+{
+ static const YCPValue value = createIdValue ( "installablepatches" );
+ return value;
+}
+
+
+// id filter uninstalled
+const YCPValue& NCPkgNames::NewPatches ()
+{
+ static const YCPValue value = createIdValue ( "newpatches" );
+ return value;
+}
+
+// id filter yast2
+const YCPValue& NCPkgNames::YaST2Patches ()
+{
+ static const YCPValue value = createIdValue ( "yast2" );
+ return value;
+}
+
+// id filter optional
+const YCPValue& NCPkgNames::Optional ()
+{
+ static const YCPValue value = createIdValue ( "optional" );
+ return value;
+}
+
+// id filter all patches
+const YCPValue& NCPkgNames::AllPatches ()
+{
+ static const YCPValue value = createIdValue ( "allpatches" );
+ return value;
+}
+
+// id information patch descr
+const YCPValue& NCPkgNames::PatchDescr ()
+{
+ static const YCPValue value = createIdValue ( "patchdescr" );
+ return value;
+}
+
+// id information patch descr
+const YCPValue& NCPkgNames::PatchPackages ()
+{
+ static const YCPValue value = createIdValue ( "patchpackages" );
+ return value;
+}
+
+const YCPValue& NCPkgNames::PatchPackagesVersions()
+{
+ static const YCPValue value = createIdValue ( "packagesversions" );
+ return value;
+}
+
+// id information directory list
+const YCPValue& NCPkgNames::DirList ()
+{
+ static const YCPValue value = createIdValue ( "dirlist" );
+ return value;
+}
+
+// id information file list
+const YCPValue& NCPkgNames::FileList ()
+{
+ static const YCPValue value = createIdValue ( "filelist" );
+ return value;
+}
+
+// id information directory name
+const YCPValue& NCPkgNames::DirName ()
+{
+ static const YCPValue value = createIdValue ( "dirname" );
+ return value;
+}
+
+// id information details view
+const YCPValue& NCPkgNames::Details ()
+{
+ static const YCPValue value = createIdValue ( "details" );
+ return value;
+}
+
+// id testcase
+const YCPValue& NCPkgNames::Testcase ()
+{
+ static const YCPValue value = createIdValue ( "testcase" );
+ return value;
+}
+
+//
+// internal use
+//
+const YCPValue& NCPkgNames::Treeitem ()
+{
+ static const YCPValue value = createIdValue ( "dummy" );
+ return value;
+}
+
+
+//
+// label, text for translation
+//
+const string NCPkgNames::WarningLabel()
+{
+ // label for a warning popup
+ static const string value = _( "Warning" );
+ return value;
+}
+
+const string NCPkgNames::ErrorLabel()
+{
+ // label for an error popup
+ static const string value = _( "Error" );
+ return value;
+}
+
+const string NCPkgNames::NotifyLabel()
+{
+ // label for a notify popup
+ static const string value = _( "Notify" );
+ return value;
+}
+
+const string NCPkgNames::RpmTreeLabel()
+{
+ // the label of the RPM-group-tags tree widget
+ static const string value = _( "RPM Groups" );
+ return value;
+}
+
+const string NCPkgNames::SelectionLabel()
+{
+ // the label of the selections
+ static const string value = _( "Package Categories" );
+ return value;
+}
+
+const string NCPkgNames::LanguageLabel()
+{
+ // the label of language table
+ static const string value = _( "Available Languages" );
+ return value;
+}
+
+const string NCPkgNames::RepoLabel()
+{
+ // the label of language table
+ static const string value = _( "Available Repositories" );
+ return value;
+}
+
+const string NCPkgNames::YOUPatches()
+{
+ // A label for a list of YOU Patches - keep it short - max 25 chars!
+ // (the list shows all patches which can be installed)
+ static const string value = _( "Installable Patches" );
+ return value;
+}
+
+const string NCPkgNames::InstPatches()
+{
+ // A label for a list of YOU Patches - keep it short - max. 25 chars!
+ // (the list shows all patches which are already installed)
+ static const string value = _( "Installed Patches" );
+ return value;
+}
+
+const string NCPkgNames::Patches()
+{
+ // A common label for a list of YOU Patches - keep it short - max. 25 chars!
+ static const string value = _( "Online Update Patches" );
+ return value;
+}
+
+const string NCPkgNames::UpdateProblem()
+{
+ // the label Filter: Update Problem ( keep it short - max. 25 chars )
+ static const string value = _( "Update Problem -- see help" );
+ return value;
+}
+
+const string NCPkgNames::OKLabel()
+{
+ // the label of an OK button
+ static const string value = _( "&OK" );
+ return value;
+}
+
+const string NCPkgNames::YesLabel()
+{
+ // the label of the Yes button
+ static const string value = _( "&Yes" );
+ return value;
+}
+
+const string NCPkgNames::AcceptLabel()
+{
+ // the label of an Accept button
+ static const string value = _( "&Accept" );
+ return value;
+}
+
+const string NCPkgNames::SaveLabel()
+{
+ // the label of the Save button
+ static const string value = _( "&Save" );
+ return value;
+}
+
+const string NCPkgNames::LoadLabel()
+{
+ // the label of the Load button
+ static const string value = _( "&Load" );
+ return value;
+}
+
+const string NCPkgNames::CancelLabel()
+{
+ // Please note: use unique hot keys for the buttons from 'begin:' to 'end:'
+ // begin: the label of the Cancel button
+ static const string value = _( "&Cancel" );
+ return value;
+}
+
+const string NCPkgNames::NoLabel()
+{
+ // the label of the No button
+ static const string value = _( "&No" );
+ return value;
+}
+
+const string NCPkgNames::IgnAllLabel()
+{
+ // the label of the Ingnore all button
+ static const string value = _( "Ignore &All" );
+ return value;
+}
+
+const string NCPkgNames::SolveLabel()
+{
+ // the label of the Solve button - 'try again' implies that user
+ // has to make some action (#213602)
+ static const string value = _( "&OK -- Try Again" );
+ return value;
+}
+
+const string NCPkgNames::IgnLabel()
+{
+ // end: the label of a Ignore button
+ static const string value = _( "&Ignore" );
+ return value;
+}
+
+const string NCPkgNames::SearchResults()
+{
+ // the label for Filter: Search results
+ static const string value = _( "Search Results" );
+ return value;
+}
+
+const string NCPkgNames::InstSummary()
+{
+ // the label for Filter: Installation summary
+ static const string value = _( "Inst. Summary" );
+ return value;
+}
+
+const string NCPkgNames::PackageSearch()
+{
+ // the headline of the search popup
+ static const string value = _( "Package Search" );
+ return value;
+}
+
+const string NCPkgNames::DepsHelpLine()
+{
+ // a help line for the dependency popup
+ static const string value = _( " [+] Select [-] Delete [>] Update " );
+ return value;
+}
+
+const string NCPkgNames::PackageDeps()
+{
+ // the headline of the dependency popup
+ static const string value = _( "Package Dependencies" );
+ return value;
+}
+
+const string NCPkgNames::SelectionDeps()
+{
+ // the headline of the popup showing dependencies between selections of packages
+ static const string value = _( "Selection Dependencies" );
+ return value;
+}
+
+const string NCPkgNames::Solving()
+{
+ // a text for a small popup which is shown during package dependency checking
+ static const string value = _( "Solving..." );
+ return value;
+}
+const string NCPkgNames::Saving()
+{
+ // a text for a small popup which is shown during writing package selection to a file
+ static const string value = _( "Saving..." );
+ return value;
+}
+const string NCPkgNames::Loading()
+{
+ // a text for a samll popup which is shown during loading package selections from a file
+ static const string value = _( "Loading..." );
+ return value;
+}
+const string NCPkgNames::SearchPhrase()
+{
+ // begin: text/labels for search popups (use unique hotkeys until the end:)
+ // text for the package search popup
+ static const string value = _( "&Search Phrase" );
+ return value;
+}
+
+const string NCPkgNames::SearchIn()
+{
+ // label of a frame in search popup (without hotkey)
+ static const string value = _( " Search in " );
+ return value;
+}
+
+const string NCPkgNames::CheckDescr()
+{
+ // label of a combo box (search popup)
+ static const string value = _( "&Description (time-consuming)" );
+ return value;
+}
+
+const string NCPkgNames::CheckName()
+{
+ // label of a combo box (search popup)
+ static const string value = _( "&Name of the Package" );
+ return value;
+}
+
+const string NCPkgNames::CheckSummary()
+{
+ // label of a combo box (search popup)
+ static const string value = _( "S&ummary" );
+ return value;
+}
+
+const string NCPkgNames::CheckProvides()
+{
+ // label of a combo box (search popup)
+ static const string value = _( "&Provides" );
+ return value;
+}
+
+const string NCPkgNames::CheckRequires()
+{
+ // label of a combo box (search popup)
+ static const string value = _( "&Requires" );
+ return value;
+}
+
+const string NCPkgNames::IgnoreCase()
+{
+ // end: text/labels for search popups
+ // label of a combo box (search popup)
+ static const string value = _( "&Ignore Case" );
+ return value;
+}
+
+const string NCPkgNames::DiskspaceLabel()
+{
+ // the headline of the disk space popup
+ static const string value = _( "Disk Usage Overview" );
+ return value;
+}
+
+const string NCPkgNames::File()
+{
+ // additional file (included in a YOU patch)
+ static const string value = _( "Additional File" );
+ return value;
+}
+
+
+const string NCPkgNames::PreScript()
+{
+ // a pre script (included in a YOU patch)
+ static const string value = _( "Pre-Script" );
+ return value;
+}
+
+const string NCPkgNames::PostScript()
+{
+ // a post script (included in a YOU patch)
+ static const string value = _( "Post-Script" );
+ return value;
+}
+
+const string NCPkgNames::Script()
+{
+ // a script (included in a YOU patch)
+ static const string value = _( "Script" );
+ return value;
+}
+
+const string NCPkgNames::MediumLabel()
+{
+ // label of a combo box (medium means floppy or hard disk)
+ static const string value = _( "&Medium" );
+ return value;
+}
+
+const string NCPkgNames::Harddisk()
+{
+ // combo box entry
+ static const string value = _( "Hard Disk" );
+ return value;
+}
+
+const string NCPkgNames::Floppy()
+{
+ // combo box entry
+ static const string value = _( "Floppy" );
+ return value;
+}
+
+const string NCPkgNames::PackageHelp()
+{
+ // the headline of the help popup
+ static const string value = _( "Package Installation Help" );
+ return value;
+}
+
+const string NCPkgNames::SearchHeadline()
+{
+ // the headline of the popup showing help on search
+ static const string value = _( "Package Search Help" );
+ return value;
+}
+
+const string NCPkgNames::YouHelp()
+{
+ // the headline of the help popup
+ static const string value = _( "Online Update Help" );
+ return value;
+}
+const string NCPkgNames::LabelUnresolvable()
+{
+ // text describing package conflict (it's a label - keep it short)
+ static const string value = _( "Unresolvable package conflict." );
+ return value;
+}
+
+const string NCPkgNames::LabelUnres()
+{
+ // text describing package conflict (it's a label - keep it short!)
+ static const string value = _( "Solve the conflict by selecting or deselecting packages." );
+ return value;
+}
+
+const string NCPkgNames::LabelAlternative()
+{
+ // text describing package dependency (it's a label - keep it short)
+ static const string value = _( "Select one of the alternatives below." );
+ return value;
+}
+
+const string NCPkgNames::LabelConflict()
+{
+ // text describing a conflict (it's a label; text continous )
+ static const string value = _( "Solve the conflict by deleting (or deselecting)" );
+ return value;
+}
+
+const string NCPkgNames::LabelPkgConflict()
+{
+ // text describing a conflict continous (package conflict)
+ static const string value = _( "the unwanted package or packages." );
+ return value;
+}
+
+const string NCPkgNames::LabelSelConflict()
+{
+ // text describing a conflict continous (selection conflict)
+ static const string value = _( "the unwanted selection or selections." );
+ return value;
+}
+
+const string NCPkgNames::LabelSelRequBy1()
+{
+ // text describing package does not work (it's a label; text contonous)
+ static const string value = _( "The selection or selections below will not work" );
+ return value;
+}
+
+const string NCPkgNames::LabelSelRequBy2()
+{
+ // text describing selection does not work continous
+ static const string value = _( "without the selection to delete." );
+ return value;
+}
+
+const string NCPkgNames::LabelPkgRequBy1()
+{
+ // text describing package does not work (it's a label; text continous )
+ static const string value = _( "The package or packages below will not work" );
+ return value;
+}
+
+const string NCPkgNames::LabelPkgRequBy2()
+{
+ // text describing package does not work continous
+ static const string value = _( "without the package to delete." );
+ return value;
+}
+
+const string NCPkgNames::LabelRequire()
+{
+ // text describing packages are not available (it's a label - keep it short!)
+ static const string value = _( "The required libraries or packages are not installed." );
+ return value;
+}
+const string NCPkgNames::LabelSelRequire()
+{
+ // text describing selections are not available (it's a label - keep it short!)
+ static const string value = _( "The required selections are not installed." );
+ return value;
+}
+
+const string NCPkgNames::FileName()
+{
+ // label of a text input field
+ static const string value = _( "Enter the file name" );
+ return value;
+}
+
+const string NCPkgNames::Version()
+{
+ // part of the package description
+ static const string value = _( "<b>Version: </b>" );
+ return value;
+}
+
+const string NCPkgNames::InstVersion()
+{
+ // part of the package description
+ static const string value = _( "<b>Installed: </b>" );
+ return value;
+}
+
+const string NCPkgNames::Authors()
+{
+ // part of the package description
+ static const string value = _( "<b>Authors: </b>" );
+ return value;
+}
+
+const string NCPkgNames::License()
+{
+ // part of the package description
+ static const string value = _( "<b>License: </b>" );
+ return value;
+}
+
+const string NCPkgNames::MediaNo()
+{
+ // part of the package description
+ static const string value = _( "<b>Media No.: </b>" );
+ return value;
+}
+
+const string NCPkgNames::Size()
+{
+ // part of the package description
+ static const string value = _( "<b>Size: </b>" );
+ return value;
+}
+
+const string NCPkgNames::RpmGroup()
+{
+ // part of the package description
+ static const string value = _( "<b>Package Group: </b>" );
+ return value;
+}
+
+const string NCPkgNames::Provides()
+{
+ // part of the package description
+ static const string value = _( "<b>Provides: </b>" );
+ return value;
+}
+
+const string NCPkgNames::Requires()
+{
+ // part of the package description
+ static const string value = _( "<b>Requires: </b>" );
+ return value;
+}
+
+const string NCPkgNames::Patch()
+{
+ // part of the patch description
+ static const string value = _( "<b>Patch: </b>" );
+ return value;
+}
+
+const string NCPkgNames::UpToDate()
+{
+ // info line is shown if YOU patch list is empty
+ static const string value = _( "The system is up to date" );
+ return value;
+}
+
+const string NCPkgNames::NoPatches()
+{
+ // info line is shown if YOU patch list is empty
+ static const string value = _( "No patches available" );
+ return value;
+}
+
+const string NCPkgNames::PreRequires()
+{
+ // part of the package description
+ static const string value = _( "<b>Prerequires: </b>" );
+ return value;
+}
+
+const string NCPkgNames::RequText()
+{
+ // text is shown in a column of a package list entry
+ // e.g. | i | aaa_base | requires ..... |
+ static const string value = _( "requires..." );
+ return value;
+}
+
+const string NCPkgNames::RequConflictText()
+{
+ // text is shown in a column of a package list entry
+ static const string value = _( "has unresolved requirements..." );
+ return value;
+}
+
+const string NCPkgNames::ObsoleteText()
+{
+ // text is shown in a column of a package list entry
+ static const string value = _( "obsoletes..." );
+ return value;
+}
+
+const string NCPkgNames::RequByText()
+{
+ // text is shown in a column of a package list entry
+ static const string value = _( "is required by..." );
+ return value;
+}
+
+const string NCPkgNames::RequiredByText()
+{
+ // part of a text
+ static const string value = _( "is required by" );
+ return value;
+}
+
+const string NCPkgNames::NotAvailableText()
+{
+ // part of a text
+ static const string value = _( "is not available" );
+ return value;
+}
+
+const string NCPkgNames::MoreText()
+{
+ // part of a text
+ static const string value = _( "needs" );
+ return value;
+}
+
+const string NCPkgNames::TabooText()
+{
+ // part of a text (package 'aa' has Taboo status)
+ static const string value = _( "is set to \"Taboo\" status" );
+ return value;
+}
+
+
+const string NCPkgNames::MoreSpaceText()
+{
+ // part of a text
+ static const string value = _( "more disk space." );
+ return value;
+}
+
+
+const string NCPkgNames::NoAvailText()
+{
+ // text is shown in a line of a package list
+ static const string value = _( "no package available" );
+ return value;
+}
+const string NCPkgNames::NeedsText()
+{
+ // text is shown in a line of a package list
+ static const string value = _( "needs packages..." );
+ return value;
+}
+const string NCPkgNames::ConflictText()
+{
+ // text is shown in a line of a package list
+ static const string value = _( "conflicts with..." );
+ return value;
+}
+const string NCPkgNames::ReinstallText()
+{
+ // text is shown in a line of a package list
+ static const string value = _( "needs to be reinstalled" );
+ return value;
+}
+const string NCPkgNames::NoConflictText()
+{
+ // text is shown in a line of a package list
+ static const string value = _( "No conflicts or unresolved dependencies" );
+ return value;
+}
+
+const string NCPkgNames::ContinueRequ()
+{
+ // label continues the part required by ...
+ static const string value = _( "...the package or packages below" );
+ return value;
+}
+
+const string NCPkgNames::ContinueSelRequ()
+{
+ // label continues the part required by ...
+ static const string value = _( "...the selection or selections below" );
+ return value;
+}
+
+const string NCPkgNames::Conflicts()
+{
+ // part of the package description
+ static const string value = _( "<b>Conflicts with: </b>" );
+ return value;
+}
+
+const string NCPkgNames::ShortDescr()
+{
+ // part of the package description
+ static const string value = _( "<b>Description: </b>" );
+ return value;
+}
+
+const string NCPkgNames::MenuFilter()
+{
+ // menu Filter
+ static const string value = _( "&Filter" );
+ return value;
+}
+
+const string NCPkgNames::MenuEntryRPMGroups()
+{
+ // menu entry RpmGroups
+ static const string value = _( "RPM &Groups" );
+ return value;
+}
+
+const string NCPkgNames::MenuEntryLanguages()
+{
+ // menu entry Languages
+ static const string value = _( "&Languages" );
+ return value;
+}
+
+const string NCPkgNames::MenuEntrySelections()
+{
+ // menu entry Selections
+ static const string value = _( "S&elections" );
+ return value;
+}
+
+const string NCPkgNames::MenuEntryRepos()
+{
+ // menu entry Repositories
+ static const string value = _( "&Repositories" );
+ return value;
+}
+
+const string NCPkgNames::MenuEntryPatterns()
+{
+ // menu entry Patterns
+ static const string value = _( "Pa&tterns" );
+ return value;
+}
+
+const string NCPkgNames::MenuEntrySearch()
+{
+ // menu entry Search
+ static const string value = _( "&Search" );
+ return value;
+}
+
+const string NCPkgNames::MenuEntryInstPkg()
+{
+ // menu entry Installed Packages
+ static const string value = _( "Installed &Packages" );
+ return value;
+}
+
+const string NCPkgNames::MenuEntryInstSummary()
+{
+ // menu entry Installed Packages
+ static const string value = _( "&Installation Summary" );
+ return value;
+}
+
+const string NCPkgNames::MenuEntryUpdateList()
+{
+ // menu entry Update List
+ static const string value = _( "&Update List" );
+ return value;
+}
+
+const string NCPkgNames::MenuEtc()
+{
+ // menu Etc.
+ static const string value = _( "&Etc." );
+ return value;
+}
+
+const string NCPkgNames::MenuDeps()
+{
+ // submenu: dependency
+ static const string value = _( "&Dependencies" );
+ return value;
+}
+
+const string NCPkgNames::MenuCheckDeps()
+{
+ // menu entry: do a dependency check
+ // Please note: preserve the whitespaces at the beginning
+ static const string value = _( " &Check Dependencies Now" );
+ return value;
+}
+
+const string NCPkgNames::MenuNoAutoDeps()
+{
+ // menu entry: dependency check off
+ static const string value = _( "[ ] &Automatic Dependency Check" );
+ return value;
+}
+
+const string NCPkgNames::MenuAutoDeps()
+{
+ // menu entry: dependency check on
+ static const string value = _( "[X] &Automatic Dependency Check" );
+ return value;
+}
+
+const string NCPkgNames::MenuVerifySystem()
+{
+ // menu entry: verify system
+ // Please note: preserve the whitespaces at the beginning
+ static const string value = _( " &Verify System" );
+ return value;
+}
+
+const string NCPkgNames::MenuTestCase()
+{
+ // menu entry: generate test case for solver
+ static const string value = _( "Generate Dependency Resolver &Test Case" );
+ return value;
+}
+
+const string NCPkgNames::MenuList()
+{
+ // submenu: selections
+ static const string value = _( "All &Packages List" );
+ return value;
+}
+
+const string NCPkgNames::MenuExportList()
+{
+ // menu entry
+ static const string value = _( "&Export to File" );
+ return value;
+}
+
+const string NCPkgNames::MenuImportList()
+{
+ // last menu entry of the Etc. menu
+ static const string value = _( "&Import from File" );
+ return value;
+}
+
+const string NCPkgNames::DiskSpaceError()
+{
+ //
+ static const string value = _( "<i>Out of disk space!</i>" );
+ return value;
+}
+
+const string NCPkgNames::DiskSpaceWarning()
+{
+ //
+ static const string value = _( "<b>Disk space is running out!</b>" );
+ return value;
+}
+
+const string NCPkgNames::AutoChangeLabel()
+{
+ // the headline of the popup containing a list with packages with status changes
+ static const string value = _( "Automatic Changes" );
+ return value;
+}
+
+const string NCPkgNames::AutoChangeText1()
+{
+ // text part1 of popup with automatic changes (it's a label; text continous)
+ static const string value = _( "In addition to your manual selections, the following" );
+ return value;
+}
+
+const string NCPkgNames::AutoChangeText2()
+{
+ // text part1 of popup with automatic changes continous
+ static const string value = _( "packages have been changed to resolve dependencies:" );
+ return value;
+}
+
+const string NCPkgNames::HelpPkgInst1()
+{
+ // part1 of help text package installation
+ static const string value = _( "<p>The package installation dialog offers the features to customize your SuSE Linux installation. You have the opportunity to make your own decision about the installation or removal of particular packages. For example, select additional categories for installation (see menu <i>Filter</i>) or deselect unwanted packages.</p>" );
+ return value;
+}
+
+const string NCPkgNames::HelpPkgInst12()
+{
+ // part of help text package installation
+ static const string value = _( "<p>The list shows all packages belonging to the current filter with status information in the first column. To change the package status, see <i>Actions</i>.</p>" );
+ return value;
+}
+
+const string NCPkgNames::HelpPkgInst13()
+{
+ // additional help text for post installation
+ static const string value = _( "<p>Be careful when deleting packages and always pay attention to <i>Warning</i> pop-ups.</p>" );
+ return value;
+}
+
+const string NCPkgNames::HelpPkgInst2()
+{
+ // part2 of help text package installation
+ static const string value = _( "Description of the menus:<br><p><b>Filter:</b> the packages shown in the package list match the selected filter, such as an RPM group, a keyword, or a category of packages (like Development or Games).</p>" );
+ return value;
+}
+
+const string NCPkgNames::HelpPkgInst3()
+{
+ // part3 of help text package installation
+ static const string value = _( "<p><b>Actions:</b> provides the possibilities to change the status of the selected package (or all packages in the list), for example, to delete a package or select an additional package for installation. The status change can also be done directly by pressing the key specified in the menu item (for detailed information about the package status, see 'Help on package status').</p>" );
+ return value;
+}
+
+const string NCPkgNames::HelpPkgInst4()
+{
+ // part4 of help text package installation
+ static const string value = _( "<p><b>Information:</b> you have the possibility to view different information about the selected package in the window on the bottom of the dialog, such as the long description, all available versions of the package, or the file list.</p>" );
+ return value;
+}
+
+const string NCPkgNames::HelpPkgInst5()
+{
+ // part5 of help text package installation
+ static const string value = _( "<p><b>Etc.:</b> The menu item 'Dependencies' offers different settings for the dependency checking. Automatic dependency check means check after every change of the package status whether all requirements are fulfilled or whether conflicts occurred.</p>" );
+ return value;
+}
+
+const string NCPkgNames::HelpPkgInst6()
+{
+ // part6 of help text package installation
+ static const string value = _( "<p>To save or load a package selection, choose 'Selections'.</p>" );
+ return value;
+}
+
+const string NCPkgNames::HelpOnSearch()
+{
+ // help text package search
+ static const string value = _( "<p>Enter a keyword for your package search. It is possible to enter only parts of a package name, for example, to search for all 3D packages with \"3d\".<br> If you are looking for a term in a package description, click the appropriate check box. Start the search with 'Enter'.</p>" );
+ return value;
+}
+
+const string NCPkgNames::HelpOnStatus1()
+{
+ // part 1 of help text package status
+ static const string value = _( "<p>The package status can be changed using the <i>Actions</i> menu or the keys specified in the menu items. For example, use '+' to install an additional package. The \"Taboo\" status means the package should not be installed or the installed version should always be kept.</p>" );
+ return value;
+}
+
+const string NCPkgNames::HelpOnStatus2()
+{
+ // part 1 of help text package status
+ static const string value = _( "<p>By default, the package dependencies are checked with every status change. You will be informed about package conflicts and additionally required packages will be selected (the menu item <i>Etc.</i>/<i>Dependencies</i> offers different settings). To resolve the conflict, select one of the offered solution and press 'OK -- Try Again'.</p>" );
+ return value;
+}
+
+const string NCPkgNames::HelpOnStatus3()
+{
+ // part 2 of help text package status
+ static const string value = _( "<p>You can also use <b>RET</b> or <b>SPACE</b> to toggle the package status." );
+ return value;
+}
+
+const string NCPkgNames::HelpOnStatus4()
+{
+ // part 3 of help text package status
+ static const string value = _( "<br>The meaning of the status flags:" );
+ return value;
+}
+
+const string NCPkgNames::HelpOnStatus5()
+{
+ // help text package status
+ static const string value = _( "<p><b> + </b>: this package is selected for installation</p><p><b>a+ </b>: automatically selected for installation</p><p><b> > </b>: update this package</p><p><b>a> </b>: automatic update</p><p><b> i </b>: this package is installed</p><p><b> - </b>: the package will be deleted</p><p><b>---</b>: never install this package</p>" );
+ return value;
+}
+
+const string NCPkgNames::HelpOnStatus6()
+{
+ // help text package status
+ static const string value = _( "<p><b>-i-</b>: the package is \"protected\" -- keep the installed version and never update or delete it.</p>" );
+ return value;
+}
+
+const string NCPkgNames::HelpOnStatus7()
+{
+ // help text package status
+ static const string value = _( "<p>The <i>Actions</i> menu also provides the possibility to change the status for all packages in the list (select 'All Listed Packages').</p>" );
+ return value;
+}
+
+const string NCPkgNames::HelpOnUpdate()
+{
+ // help text package status
+ static const string value = _( "<b>Update Problem List</b><br><p>The packages in the list cannot be updated automatically.</p><p>Possible reasons:</p><p>They are obsoleted by other packages.</p><p>There is no newer version to which to update on any installation media.</p><p>They are third-party packages</p><p>Manually select what to do with them. The safest course of action is to delete them.</p>" );
+ return value;
+}
+
+const string NCPkgNames::PkgName()
+{
+ // column header package name (keep it short!)
+ static const string value = _( "Name" );
+ return value;
+}
+
+const string NCPkgNames::PackageName()
+{
+ // column header (keep it short!)
+ static const string value = _( "Package/Library" );
+ return value;
+}
+
+const string NCPkgNames::SelectionName()
+{
+ // column header selection name (keep it short!)
+ static const string value = _( "Selection" );
+ return value;
+}
+
+const string NCPkgNames::PkgVersion()
+{
+ // column header installed package version (keep it short!)
+ static const string value = _( "Version" );
+ return value;
+}
+
+const string NCPkgNames::PkgInstSource()
+{
+ // column header - repository of the package (e.g. openSUSE 10.3)
+ static const string value = _( "Repository" );
+ return value;
+}
+
+const string NCPkgNames::PkgVersionNew()
+{
+ // column header available package version (keep it short - use abbreviation!)
+ static const string value = _( "Avail. Vers." );
+ return value;
+}
+
+const string NCPkgNames::PkgVersionInst()
+{
+ // column header installed package version (keep it short - use abbreviation!)
+ static const string value = _( "Inst. Vers." );
+ return value;
+}
+
+const string NCPkgNames::PkgSummary()
+{
+ // column header package description (keep it short!)
+ static const string value = _( "Summary" );
+ return value;
+}
+
+
+const string NCPkgNames::PkgSize()
+{
+ // column header package size (keep it short!)
+ static const string value = _( "Size" );
+ return value;
+}
+
+const string NCPkgNames::PkgArch()
+{
+ // column header package architecture (keep it short!)
+ static const string value = _( "Architecture" );
+ return value;
+}
+
+const string NCPkgNames::PkgSource()
+{
+ // column header source RPM installation (keep it short!)
+ static const string value = _( "Source" );
+ return value;
+}
+
+const string NCPkgNames::PatchKind()
+{
+ // column header patch kind (keep it short!)
+ static const string value = _( "Kind" );
+ return value;
+}
+
+const string NCPkgNames::DepsKind()
+{
+ // column header kind of the package dependency, e.g. conflict (keep it short!)
+ static const string value = _( "Kind of Dependency" );
+ return value;
+}
+
+const string NCPkgNames::Comment()
+{
+ // column header comment (keep it short!)
+ static const string value = _( "Additional Information" );
+ return value;
+}
+
+const string NCPkgNames::PkgStatus()
+{
+ // column header status
+ static const string value = string(" ");
+ return value;
+}
+
+const string NCPkgNames::LangCode()
+{
+ static const string value = _("Code");
+ return value;
+}
+
+const string NCPkgNames::LangName()
+{
+ static const string value = _("Language");
+ return value;
+}
+
+const string NCPkgNames::RepoURL()
+{
+ static const string value = _("URL");
+ return value;
+
+}
+
+const string NCPkgNames::Partition()
+{
+ // column header name of the partition (keep it short!)
+ static const string value = _( "Partition" );
+ return value;
+}
+
+const string NCPkgNames::UsedSpace()
+{
+ // column header used disk space (keep it short!)
+ static const string value = _( "Used" );
+ return value;
+}
+
+const string NCPkgNames::FreeSpace()
+{
+ // column header free disk space (keep it short!)
+ static const string value = _( "Free" );
+ return value;
+}
+
+const string NCPkgNames::TotalSpace()
+{
+ // column header total disk space (keep it short!)
+ static const string value = _( "Total" );
+ return value;
+}
+
+const string NCPkgNames::ListOfFiles()
+{
+ // headline for a list of installed files
+ static const string value = _( "<i>List of Installed Files:</i><br>" );
+ return value;
+}
+
+const string NCPkgNames::YouHelp1()
+{
+ // help text online udpate
+ // Do NOT translate 'recommended' and 'security'! because the patch kind is always shown as english text.
+ static const string value = _( "<p>Mode \"recommended\" means you should install the patch. \"security\" is a security patch and it is highly recommended to install it. \"YaST2\" patches will be always installed first. The other patches must be installed on a second run.</p>" );
+ return value;
+}
+
+const string NCPkgNames::YouHelp2()
+{
+ // help text online udpate continue
+ static const string value = _( "<p>Meaning of the status flags:</p><p><b>+</b>: Patches concerning your installation are preselected. They will be downloaded and installed on your system. If you do not want a certain patch, deselect it with '-'.</p>" );
+ return value;
+}
+
+const string NCPkgNames::YouHelp3()
+{
+ // help text online udpate continue
+ static const string value = _( "<p><b>i</b>: This patch is already installed.</p><p><b>></b>: The patch will be reinstalled.</p>" );
+ return value;
+}
+
+const string NCPkgNames::TextmodeHelp1()
+{
+ // part of help for text mode navigation
+ static const string value = _( "<p>Special keys:<br>Function keys provide a quick access to the main functions (frequently used buttons) of this dialog. See the listing below to get the bindings.</p>" );
+ return value;
+}
+
+const string NCPkgNames::TextmodeHelp2()
+{
+ // part of help for text mode navigation
+ static const string value = _( "<p>Shortcuts are used to perform the desired action by pressing the <b>Alt</b> key followed by the key marked in the corresponding button, check box, radio button, or other item.</p>If the <b>Alt</b> key combinations are captured by the X server, use <b>ESC</b> instead." );
+ return value;
+}
+
+const string NCPkgNames::TextmodeHelp3()
+{
+ // part of help for text mode navigation
+ static const string value = _( "<p>General keyboard navigation:</p>" );
+ return value;
+}
+
+const string NCPkgNames::TextmodeHelp4()
+{
+ // part of help for text mode navigation
+ static const string value = _( "<p>To move inside a dialog, use <b>Tab</b> to go forward and <b>Alt</b> or <b>Shift</b> + <b>Tab</b> to go back.<br> If the <b>Alt</b> and <b>Shift</b> key combinations are occupied by the window manager or the terminal, <b>Ctrl</b> + <b>F</b> (forward) and <b>Ctrl</b> + <b>B</b> (back) can be used instead.</p>." );
+ return value;
+}
+const string NCPkgNames::TextmodeHelp5()
+{
+ // part of help for text mode navigation
+ static const string value = _( "<p>The command specified on an activated button (e.g., Next, Add) is executed if the <b>Enter</b> key is pressed.</p> <p>Radio buttons or check boxes are switched on or off with <b>Enter</b> or <b>Space</b>. " );
+
+ return value;
+}
+const string NCPkgNames::TextmodeHelp6()
+{
+ // part of help for text mode navigation
+ static const string value = _( "<p>Scroll in lists or text (e.g., the help text) with the <b>arrow</b> keys.</p>" );
+ return value;
+}
+
+const string NCPkgNames::SaveSelHeadline()
+{
+ // headline for the popup
+ static const string value = _( "Save Package List" );
+ return value;
+}
+
+const string NCPkgNames::SaveSelText()
+{
+ // text for thepopup "Save Package List"
+ static const string value = _( "<p>The current package selection can be saved on a floppy (insert a formatted floppy) or on the hard disk.<br>Select the medium and specify the file name in the input field below.</p>" );
+ return value;
+}
+
+const string NCPkgNames::SaveErr1Text()
+{
+ // text for an Error popup
+ static const string value = _( "<p>Could not find a formatted floppy. Check that a formatted and verified floppy is inserted in the drive.</p>" );
+ return value;
+}
+
+const string NCPkgNames::SaveErr2Text()
+{
+ // text for an Error popup
+ static const string value = _( "<p>Could not write to file.<br>Check that the path name is correct and the directory is accessible.</p>" );
+ return value;
+}
+
+const string NCPkgNames::Saved1Text()
+{
+ // text for a Notify popup
+ static const string value = _( "<p>Your settings have been saved to the floppy disk.</p>" );
+ return value;
+}
+
+const string NCPkgNames::Saved2Text()
+{
+ // text for a Notify popup
+ static const string value = _( "<p>Your package selection has been written to the hard disk.</p>" );
+ return value;
+}
+
+const string NCPkgNames::LoadSelHeadline()
+{
+ // headline for the popup
+ static const string value = _( "Load Package List" );
+ return value;
+}
+
+const string NCPkgNames::LoadSel1Text()
+{
+ // text for a Notify popup
+ static const string value = _( "<p>Really overwrite your package selection?</p>" );
+ return value;
+}
+
+const string NCPkgNames::LoadSel2Text()
+{
+ // text for popup "Load Package List"
+ static const string value = _( "<p>Specify the medium and the name of the file containing the user-defined package selection to install.<br>If required, insert the floppy.</p>" );
+ return value;
+}
+
+const string NCPkgNames::LoadErr1Text()
+{
+ // text for an Error popup
+ static const string value = _( "<p>Could not mount the floppy. Check that the floppy is inserted in the drive.</p>" );
+ return value;
+}
+
+const string NCPkgNames::LoadErr2Text()
+{
+ // text for an Error popup
+ static const string value = _( "<p>Could not load the settings.<br>Check that the path name is correct and the floppy disk, if required, is inserted correctly.</p>" );
+ return value;
+}
+
+const string NCPkgNames::LoadedText()
+{
+ // text for a Notify popup
+ static const string value = _( "<p>The package selection is loaded succesfully.</p>" );
+ return value;
+}
+
+const string NCPkgNames::CancelText()
+{
+ // text for a Notify popup
+ static const string value = _( "<p>All changes in package, patch or pattern selection will be lost.<br>Really exit?</p>" );
+ return value;
+}
+
+///////////////////////////////////////////////////////////////////
+
+
+
Added: branches/tmp/bubli/ncurses-pkg/src/NCPkgNames.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/NCPkgNames.h?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/src/NCPkgNames.h (added)
+++ branches/tmp/bubli/ncurses-pkg/src/NCPkgNames.h Fri Feb 8 13:59:32 2008
@@ -0,0 +1,945 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: NCPkgNames.h
+
+ Author: Gabriele Strattner
+ Maintainer: Michael Andres
+
+/-*/
+#ifndef NCPkgNames_h
+#define NCPkgNames_h
+
+#include "NCstring.h"
+#include <string>
+
+
+class YCPValue;
+
+
+// Class to make available globally used names in package selection dialog,
+// such as widget ids, text which has to be translated and so on
+
+class NCPkgNames
+{
+public:
+
+ /**
+ * Widget id of the package table ( list of packages )
+ */
+ static const YCPValue& Packages ();
+
+ /**
+ * Widget id of the list of available packages
+ */
+ static const YCPValue& AvailPkgs ();
+
+ /**
+ * Widget id of the list of patch packages
+ */
+ static const YCPValue& PatchPkgs ();
+
+ /**
+ * Widget id of the list of patch packages verions
+ */
+ static const YCPValue& PatchPkgsVersions ();
+
+ /**
+ * Widget id of the description section ( shown on bottom of the selection dialog )
+ */
+ static const YCPValue& Description ();
+
+ /**
+ * Widget id of the file list information ( shown on bottom of the selection dialog )
+ */
+ static const YCPValue& FilelistId ();
+
+ /**
+ * Widget id of the ReplacePoint
+ */
+ static const YCPValue& ReplPoint();
+
+ /**
+ * Widget id of the menu item Action/Toggle
+ */
+ static const YCPValue& Toggle ();
+
+ /**
+ * Widget id of the menu item Action/Select
+ */
+ static const YCPValue& Select ();
+
+ /**
+ * Widget id of the menu item Action/Delete
+ */
+ static const YCPValue& Delete ();
+
+ /**
+ * Widget id of the menu item Action/Taboo On
+ */
+ static const YCPValue& TabooOn ();
+
+ /**
+ * Widget id of the menu item Action/Taboo Off
+ */
+ static const YCPValue& TabooOff ();
+
+ /**
+ * Widget id of the menu item Action/SPM yes
+ */
+ static const YCPValue& SourceYes ();
+ static const YCPValue& SourceNo ();
+
+ /**
+ * Widget id of the menu item Action/All packages/Delete all
+ */
+ static const YCPValue& DeleteAll ();
+
+ /**
+ * Widget id of the menu item Action/All packages/Delete all
+ */
+ static const YCPValue& DontDelete ();
+
+ /**
+ * Widget id of the menu item Action/All packages/Select all
+ */
+ static const YCPValue& InstallAll ();
+
+ /**
+ * Widget id of the menu item Action/All packages/Select all
+ */
+ static const YCPValue& DontInstall ();
+
+ /**
+ * Widget id of the menu item Action/All packages/Update if newer version available
+ */
+ static const YCPValue& UpdateNewer();
+
+ /**
+ * Widget id of the menu item Action/All packages/Update all
+ */
+ static const YCPValue& UpdateAll();
+
+ /**
+ * Widget id of the menu item Action/All packages/Update all
+ */
+ static const YCPValue& DontUpdate();
+
+ /**
+ * Widget id of the menu item Action/Update
+ */
+ static const YCPValue& Update ();
+
+ /**
+ * Widget id of the search button
+ */
+ static const YCPValue& Search ();
+
+ /**
+ * Widget id of the menu item Information/Long description
+ */
+ static const YCPValue& LongDescr ();
+
+ /**
+ * Widget id of the menu item Information/Versions
+ */
+ static const YCPValue& Versions ();
+
+ /**
+ * Widget id of the menu item Information/Package info
+ */
+ static const YCPValue& PkgInfo ();
+
+ /**
+ * Widget id of the menu item Information/File list
+ */
+ static const YCPValue& Files ();
+
+ /**
+ * Widget id of the menu item Help/Udpate
+ */
+ static const YCPValue& UpdateHelp ();
+
+ /**
+ * Widget id of the menu item Help/Search
+ */
+ static const YCPValue& SearchHelp ();
+
+ /**
+ * Widget id of the menu item Information/Relations
+ */
+ static const YCPValue& Relations ();
+
+ /**
+ * Widget id of the menu item RPM groups
+ */
+ static const YCPValue& RpmGroups ();
+
+ /**
+ * Widget id of the menu item What if ...
+ */
+ static const YCPValue& Whatif ();
+
+ /**
+ * Widget id of the menu item Installed Packages
+ */
+ static const YCPValue& Installed ();
+
+ /**
+ * Widget id of the menu item Selections
+ */
+ static const YCPValue& Selections ();
+ static const YCPValue& Patterns ();
+ static const YCPValue& Languages ();
+ static const YCPValue& Repositories ();
+
+ /**
+ * Widget id of the menu item update list
+ */
+ static const YCPValue& UpdateList ();
+
+ /**
+ * Widget id of the label which shows the selected filter
+ */
+ static const YCPValue& Filter ();
+
+ /**
+ * Widget id of the label for disk space information
+ */
+ static const YCPValue& Diskspace ();
+
+ /**
+ * Widget id of the Etc./Dependencies/Check deps menu item
+ */
+ static const YCPValue& ShowDeps ();
+
+ /**
+ * Widget id of the Etc./Dependencies/verify system menu item
+ */
+ static const YCPValue& VerifySystem ();
+
+ /**
+ * Widget id of the Etc./Dependencies/Auto check menu item
+ */
+ static const YCPValue& AutoDeps ();
+
+ /**
+ * Widget id of the Etc./Package List/Export menu item
+ */
+ static const YCPValue& ExportToFile ();
+
+ /**
+ * Widget id of the Etc./Package List/Import menu item
+ */
+ static const YCPValue& ImportFromFile ();
+
+ /**
+ * Widget id of the Etc./Selections menu item
+ */
+ static const YCPValue& SaveSel ();
+
+ /**
+ * Widget id of the Etc./Selections check menu item
+ */
+ static const YCPValue& LoadSel ();
+
+ /**
+ * Widget id for internal use
+ */
+ static const YCPValue& ReplaceMenu ();
+ static const YCPValue& ReplaceFilter ();
+
+ /**
+ * Widget id of the button disk space
+ */
+ static const YCPValue& Diskinfo ();
+
+ /**
+ * Widget id of the cancel button
+ */
+ static const YCPValue& Cancel ();
+
+ /**
+ * Widget id of the ok button
+ */
+ static const YCPValue& OkButton ();
+
+ /**
+ * Widget id combo box
+ */
+ static const YCPValue& SearchBox ();
+
+ /**
+ * Widget id of the solve button
+ */
+ static const YCPValue& Solve ();
+
+ /**
+ * Widget id of the Ignore button
+ */
+ static const YCPValue& Ignore ();
+
+ /**
+ * Widget id of the Ignore all button
+ */
+ static const YCPValue& IgnoreAll ();
+
+ /**
+ * Widget id of general help menu item
+ */
+ static const YCPValue& GeneralHelp ();
+
+ /**
+ * Widget id of status help menu item
+ */
+ static const YCPValue& StatusHelp ();
+
+ /**
+ * Widget id of filter help menu item
+ */
+ static const YCPValue& FilterHelp ();
+
+ /**
+ * Widget id of help YOU
+ */
+ static const YCPValue& PatchHelp ();
+
+ /**
+ * Widget id of Filter/recommended
+ */
+ static const YCPValue& Recommended ();
+
+ /**
+ * Widget id of Filter/security
+ */
+ static const YCPValue& Security ();
+
+ /**
+ * Widget id of Filter/optional
+ */
+ static const YCPValue& Optional ();
+
+ /**
+ * Widget id of Filter/installed
+ */
+ static const YCPValue& InstalledPatches ();
+
+ /**
+ * Widget id of Filter/installable
+ */
+ static const YCPValue& InstallablePatches ();
+
+ /**
+ * Widget id of Filter/all patches
+ */
+ static const YCPValue& AllPatches ();
+
+ /**
+ * Widget id of Filter/new patches
+ */
+ static const YCPValue& NewPatches ();
+
+ /**
+ * Widget id of Filter/YaST2 patches
+ */
+ static const YCPValue& YaST2Patches ();
+
+ /**
+ * Widget id information patch descr
+ */
+ static const YCPValue& PatchDescr ();
+
+ /**
+ * Widget id information patch packages
+ */
+ static const YCPValue& PatchPackages ();
+
+ /**
+ * Widget id information patch packages versions
+ */
+ static const YCPValue& PatchPackagesVersions ();
+
+ /**
+ * Widget id of the directory list
+ */
+ static const YCPValue& DirList ();
+
+ /**
+ * Widget id of the file list
+ */
+ static const YCPValue& FileList ();
+
+ /**
+ * Widget id of the diretcory name
+ */
+ static const YCPValue& DirName ();
+
+ /**
+ * Widget id of the details view
+ */
+ static const YCPValue& Details ();
+
+ /**
+ * Widget id testcase
+ */
+ static const YCPValue& Testcase ();
+
+ /**
+ * Internal use (id for the tree items)
+ */
+ static const YCPValue& Treeitem();
+
+ /**
+ * The label of the RPM-group-tags tree widget
+ */
+ static const string RpmTreeLabel();
+
+ /**
+ * The headline of the disk space popup
+ */
+ static const string DiskspaceLabel();
+
+ /**
+ * The label of the package selections popup
+ */
+ static const string SelectionLabel();
+
+ /**
+ * The label of the language selections popup
+ */
+ static const string LanguageLabel();
+
+ /**
+ * The label of the repositories selections popup
+ */
+ static const string RepoLabel();
+ /**
+ * The label Filter: YOU Patches
+ */
+ static const string YOUPatches();
+ static const string InstPatches();
+ static const string Patches();
+
+ /**
+ * The label for Filter: Search results
+ */
+ static const string SearchResults();
+
+ /**
+ * The label for Filter: Installation Summary
+ */
+ static const string InstSummary();
+
+ /**
+ * The label for Filter: Update problem
+ */
+ static const string UpdateProblem();
+
+ /**
+ * The headline of the search popup
+ */
+ static const string PackageSearch();
+
+ /**
+ * The headline of the dependency popup
+ */
+ static const string PackageDeps();
+ static const string SelectionDeps();
+
+ /**
+ * The headline of the disk space popup
+ */
+ static const string DiskSpaceError();
+ static const string DiskSpaceWarning();
+
+ static const string LabelUnres();
+ static const string LabelAlternative();
+
+ static const string LabelConflict();
+ static const string LabelSelConflict();
+ static const string LabelPkgConflict();
+
+ static const string LabelPkgRequBy1();
+ static const string LabelPkgRequBy2();
+
+ static const string LabelSelRequBy1();
+ static const string LabelSelRequBy2();
+
+ static const string LabelRequire();
+ static const string LabelSelRequire();
+ static const string LabelUnresolvable();
+ static const string WarningLabel();
+ static const string ErrorLabel();
+ static const string NotifyLabel();
+ static const string DepsHelpLine();
+ static const string Solving();
+ static const string Saving();
+ static const string Loading();
+ static const string ContinueRequ();
+ static const string ContinueSelRequ();
+
+ static const string File();
+ static const string PreScript();
+ static const string PostScript();
+ static const string Script();
+
+ /**
+ * text used in search popup
+ */
+ static const string SearchPhrase();
+
+ /**
+ * text used in search popup
+ */
+ static const string CheckDescr();
+
+ /**
+ * text used in search popup
+ */
+ static const string IgnoreCase();
+
+ /**
+ * text used in search popup
+ */
+ static const string SearchIn();
+
+ /**
+ * text used in search popup
+ */
+ static const string CheckName();
+
+ /**
+ * text used in search popup
+ */
+ static const string CheckSummary();
+
+ /**
+ * text used in search popup
+ */
+ static const string CheckProvides();
+
+ /**
+ * text used in search popup
+ */
+ static const string CheckRequires();
+
+ /**
+ * The headline of the help popup
+ */
+ static const string PackageHelp();
+
+ /**
+ * The headline of the search help popup
+ */
+ static const string SearchHeadline();
+
+ /**
+ * The headline of the help YOU popup
+ */
+ static const string YouHelp();
+
+ /**
+ * The label of the OK button
+ */
+ static const string OKLabel();
+
+ /**
+ * The label of the Yes button
+ */
+ static const string YesLabel();
+
+ /**
+ * The label of the Accept button
+ */
+ static const string AcceptLabel();
+
+ /**
+ * The label of the Cancel button
+ */
+ static const string CancelLabel();
+
+ /**
+ * The label of the No button
+ */
+ static const string NoLabel();
+
+ /**
+ * The label of the Cancel/Ignore button
+ */
+ static const string CancelIgnore();
+
+ /**
+ * The label of the Ignore All button
+ */
+ static const string IgnAllLabel();
+
+ /**
+ * The label of the Ignore button
+ */
+ static const string IgnLabel();
+
+ /**
+ * The label of the Solve button
+ */
+ static const string SolveLabel();
+
+ /**
+ * The label of the Save button
+ */
+ static const string SaveLabel();
+
+ /**
+ * The label of the Load button
+ */
+ static const string LoadLabel();
+
+ /**
+ * The label of text input field
+ */
+ static const string FileName();
+
+ /**
+ * The label of the combo box medium
+ */
+ static const string MediumLabel();
+
+ /**
+ * A combo box entry
+ */
+ static const string Harddisk();
+
+ /**
+ * A combo box entry
+ */
+ static const string Floppy();
+
+ /**
+ * Part 1 of help text package installation
+ */
+ static const string HelpPkgInst1();
+
+ /**
+ * Part 12 of help text package installation
+ */
+ static const string HelpPkgInst12();
+
+ /**
+ * Part 13 of help text package installation
+ */
+ static const string HelpPkgInst13();
+
+ /**
+ * help text package status
+ */
+ static const string HelpOnStatus1();
+ static const string HelpOnStatus2();
+ static const string HelpOnStatus3();
+ static const string HelpOnStatus4();
+ static const string HelpOnStatus5();
+ static const string HelpOnStatus6();
+ static const string HelpOnStatus7();
+
+ static const string YouHelp1();
+ static const string YouHelp2();
+ static const string YouHelp3();
+
+ static const string TextmodeHelp1();
+ static const string TextmodeHelp2();
+ static const string TextmodeHelp3();
+ static const string TextmodeHelp4();
+ static const string TextmodeHelp5();
+ static const string TextmodeHelp6();
+
+ /**
+ * text used for automatic changes popup
+ */
+ static const string AutoChangeLabel();
+ static const string AutoChangeText1();
+ static const string AutoChangeText2();
+
+ /**
+ * Part of help text used in installed system
+ */
+ static const string HelpPkgPostInst();
+
+ /**
+ * Part 2 of help text package installation
+ */
+ static const string HelpPkgInst2();
+ /**
+ * Part 3 of help text package installation
+ */
+ static const string HelpPkgInst3();
+ /**
+ * Part 4 of help text package installation
+ */
+ static const string HelpPkgInst4();
+
+ /**
+ * Part 5 of help text package installation
+ */
+ static const string HelpPkgInst5();
+
+ /**
+ * Part 6 of help text package installation
+ */
+ static const string HelpPkgInst6();
+
+ static const string HelpOnUpdate();
+
+ /**
+ * help package search
+ */
+ static const string HelpOnSearch();
+
+ /**
+ * bold text Version: (richtext)
+ */
+ static const string Version();
+
+ /**
+ * bold text Installed version: (richtext)
+ */
+ static const string InstVersion();
+
+ /**
+ * bold text License: (richtext)
+ */
+ static const string License();
+
+ /**
+ * bold text Media No.: (richtext)
+ */
+ static const string MediaNo();
+
+ /**
+ * bold text Size: (richtext)
+ */
+ static const string Size();
+
+ /**
+ * bold text Patch: (richtext)
+ */
+ static const string Patch();
+
+ /**
+ * Info line in empty patch list
+ */
+ static const string UpToDate();
+
+ /**
+ * Info line in empty patch list
+ */
+ static const string NoPatches();
+
+ /**
+ * bold text Package Group: (richtext)
+ */
+ static const string RpmGroup();
+
+ /**
+ * bold text Authors: (richtext)
+ */
+ static const string Authors();
+
+ /**
+ * bold text Provides: (richtext)
+ */
+ static const string Provides();
+
+ /**
+ * bold text Description: (richtext)
+ */
+ static const string ShortDescr();
+
+ /**
+ * bold text Requires: (richtext)
+ */
+ static const string Requires();
+
+ /**
+ * bold text Required by: (richtext)
+ */
+ static const string PreRequires();
+
+ /**
+ * bold text Conflicts with: (richtext)
+ */
+ static const string Conflicts();
+
+ /**
+ * Column header package name
+ */
+ static const string PkgName();
+
+ /**
+ * Column header package name
+ */
+ static const string PackageName();
+
+ /**
+ * Column header selection name
+ */
+ static const string SelectionName();
+
+ /**
+ * Column header package version installed
+ */
+ static const string PkgVersion();
+
+ /**
+ * Column header package source installed
+ */
+ static const string PkgInstSource();
+
+ /**
+ * Column header package version new
+ */
+ static const string PkgVersionNew();
+
+ /**
+ * Column header package version installed
+ */
+ static const string PkgVersionInst();
+
+ /**
+ * Column header package summary
+ */
+ static const string PkgSummary();
+
+ /**
+ * Column header package size
+ */
+ static const string PkgSize();
+
+ /**
+ * Column header package architecture
+ */
+ static const string PkgArch();
+
+ /**
+ * Column header package source
+ */
+ static const string PkgSource();
+
+ /**
+ * Column header patch kind
+ */
+ static const string PatchKind();
+
+ /**
+ * Column header dependency kind
+ */
+ static const string DepsKind();
+
+ /**
+ * Column header comment
+ */
+ static const string Comment();
+
+ /**
+ * Column header package status
+ */
+ static const string PkgStatus();
+
+ static const string LangCode();
+ static const string LangName();
+
+ static const string RepoURL();
+
+ static const string Partition();
+ static const string UsedSpace();
+ static const string FreeSpace();
+ static const string TotalSpace();
+
+ static const string ListOfFiles();
+
+ /**
+ * dependency popup text
+ */
+ static const string RequText();
+ static const string RequConflictText();
+ static const string ObsoleteText();
+
+ static const string RequByText();
+ static const string ReinstallText();
+ static const string RequiredByText();
+ static const string NoAvailText();
+ static const string NeedsText();
+ static const string ConflictText();
+ static const string NoConflictText();
+ static const string NotAvailableText();
+
+ static const string MenuEtc();
+ static const string MenuDeps();
+ static const string MenuCheckDeps();
+ static const string MenuAutoDeps();
+ static const string MenuNoAutoDeps();
+ static const string MenuVerifySystem();
+ static const string MenuTestCase();
+ static const string MenuList();
+ static const string MenuExportList();
+ static const string MenuImportList();
+
+ static const string MoreText();
+ static const string TabooText();
+ static const string MoreSpaceText();
+
+ static const string MenuFilter();
+ static const string MenuEntryRPMGroups();
+ static const string MenuEntryLanguages();
+ static const string MenuEntryRepos();
+ static const string MenuEntrySelections();
+ static const string MenuEntryPatterns();
+ static const string MenuEntrySearch();
+ static const string MenuEntryInstPkg();
+ static const string MenuEntryInstSummary();
+ static const string MenuEntryUpdateList();
+
+
+ /**
+ * save/load selections
+ */
+ static const string SaveErr1Text();
+ static const string SaveErr2Text();
+ static const string SaveSelHeadline();
+ static const string SaveSelText();
+ static const string Saved1Text();
+ static const string Saved2Text();
+
+ static const string LoadSelHeadline();
+ static const string LoadSel1Text();
+ static const string LoadSel2Text();
+ static const string LoadErr1Text();
+ static const string LoadErr2Text();
+ static const string LoadedText();
+ static const string CancelText();
+
+private:
+
+ // Need no object of this class: hide default constructor
+ NCPkgNames();
+
+ /**
+ * Create an id value with ` at the beginning
+ */
+ static YCPValue createIdValue ( const std::string &name );
+
+};
+
+
+///////////////////////////////////////////////////////////////////
+
+#endif // NCPkgNames_h
+
+
+
Added: branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupDeps.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupDeps.cc?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupDeps.cc (added)
+++ branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupDeps.cc Fri Feb 8 13:59:32 2008
@@ -0,0 +1,549 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: NCPkgPopupDeps.cc
+
+ Author: Gabriele Strattner
+ Maintainer: Bubli
+
+/-*/
+#include "Y2Log.h"
+#include "NCPkgPopupDeps.h"
+
+#include "NCAlignment.h"
+#include "NCTree.h"
+#include "YDialog.h"
+#include "NCLayoutBox.h"
+#include "NCSpacing.h"
+#include "NCPkgNames.h"
+#include "NCSelectionBox.h"
+#include "NCMultiSelectionBox.h"
+#include "NCPushButton.h"
+#include "NCPopupInfo.h"
+#include "NCInputField.h"
+
+#include "NCi18n.h"
+
+/*
+ Textdomain "packages"
+*/
+
+class NCProblemSelectionBox : public NCSelectionBox
+{
+ typedef NCProblemSelectionBox Self;
+ NCProblemSelectionBox (const Self &); // prohibit copying
+ Self & operator= (const Self &); // prohibit assignment
+
+ NCPkgPopupDeps * depsPopup; // to notify about changes
+
+protected:
+ virtual NCursesEvent wHandleInput( wint_t ch );
+
+public:
+ NCProblemSelectionBox (YWidget * parent, const string & label,
+ NCPkgPopupDeps * aDepsPopup)
+ : NCSelectionBox( parent, label),
+ depsPopup (aDepsPopup) {}
+
+ virtual ~NCProblemSelectionBox () {}
+};
+
+class NCSolutionSelectionBox : public NCMultiSelectionBox
+{
+ typedef NCSolutionSelectionBox Self;
+ NCSolutionSelectionBox (const Self &); // prohibit copying
+ Self & operator= (const Self &); // prohibit assignment
+
+ NCPkgPopupDeps * depsPopup;
+
+protected:
+ virtual NCursesEvent wHandleInput( wint_t ch );
+
+public:
+ NCSolutionSelectionBox (YWidget * parent, const string & label,
+ NCPkgPopupDeps * aDepsPopup)
+ : NCMultiSelectionBox( parent, label)
+ , depsPopup (aDepsPopup) {}
+
+ virtual ~NCSolutionSelectionBox () {}
+};
+
+using namespace std;
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupDeps::NCPkgPopupDeps
+// METHOD TYPE : Constructor
+//
+// DESCRIPTION :
+//
+NCPkgPopupDeps::NCPkgPopupDeps( const wpos at, NCPackageSelector * pkger )
+ : NCPopup( at, false )
+ , cancelButton( 0 )
+ , solveButton( 0 )
+ , solutionw( 0 )
+ , head( 0 )
+ , details( 0 )
+ , packager( pkger )
+ , problemw( 0 )
+
+{
+ createLayout();
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupDeps::~NCPkgPopupDeps
+// METHOD TYPE : Destructor
+//
+// DESCRIPTION :
+//
+NCPkgPopupDeps::~NCPkgPopupDeps()
+{
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPopupSelDeps::createLayout
+// METHOD TYPE : void
+//
+// DESCRIPTION :
+//
+void NCPkgPopupDeps::createLayout( )
+{
+
+ // vertical split is the (only) child of the dialog
+ NCLayoutBox * vSplit = new NCLayoutBox( this, YD_VERT );
+
+ // FIXME
+ // opt.vWeight.setValue( 40 );
+
+ vSplit->setNotify( true );
+
+ new NCSpacing( vSplit, YD_VERT, false, 1 );
+
+ head = new NCLabel( vSplit, "", true, false ); // isHeading = true
+
+ //vSplit->addChild( new NCSpacing( vSplit, opt, 0.4, false, true ) );
+ new NCSpacing( vSplit, YD_VERT, false, 1 );
+
+ // add the list containing packages with unresolved dependencies
+ problemw = new NCProblemSelectionBox( vSplit, _("&Problems"), this);
+ problemw->setStretchable( YD_HORIZ, true );
+
+ //vSplit->addChild( new NCSpacing( vSplit, opt, 0.2, false, true ) );
+ new NCSpacing( vSplit, YD_VERT, false, 1 );
+
+ NCAlignment * left = new NCAlignment( vSplit, YAlignBegin, YAlignUnchanged );
+
+ // heading = false, outputField = true
+ details = new NCLabel ( left,"", false, true );
+
+ //vSplit->addChild( new NCSpacing( vSplit, opt, 0.8, false, true ) );
+ new NCSpacing( vSplit, YD_VERT, false, 1 ); // stretchable = true
+
+ // add the package list containing the dependencies
+ solutionw = new NCSolutionSelectionBox ( vSplit, _("Possible &Solutions"), this);
+
+ //vSplit->addChild( new NCSpacing( vSplit, opt, 0.6, false, true ) );
+ new NCSpacing( vSplit, YD_VERT, false, 1 ); // stretchable = false
+
+ NCLayoutBox * hSplit = new NCLayoutBox( vSplit, YD_HORIZ );
+
+
+ // add the solve button
+ solveButton = new NCPushButton( hSplit, NCPkgNames::SolveLabel() );
+ solveButton->setFunctionKey( 10 );
+
+ //hSplit->addChild( new NCSpacing( hSplit, opt, 0.2, true, false ) );
+ new NCSpacing( hSplit, YD_HORIZ, true, 0.2 ); // stretchable = true
+
+ // add the cancel button
+ cancelButton = new NCPushButton( hSplit, NCPkgNames::CancelLabel() );
+ cancelButton->setFunctionKey( 9 );
+
+ new NCSpacing( vSplit, YD_VERT, false, 1 ); // stretchable = false
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// showDependencies
+//
+//
+bool NCPkgPopupDeps::showDependencies( NCPkgSolverAction action, bool * ok )
+{
+ if ( !problemw )
+ return true;
+
+ bool cancel = false;
+
+ // set headline and table type
+ if ( head )
+ head->setLabel( NCPkgNames::PackageDeps() );
+
+ // evaluate the result and fill the list with packages
+ // which have unresolved deps
+ bool success = solve (problemw, action );
+ *ok = success;
+
+ if (!success)
+ {
+ // show first dependency
+ showSolutions( problemw->getCurrentItem() );
+ NCursesEvent input = showDependencyPopup( action ); // show the dependencies
+
+ if ( input == NCursesEvent::cancel
+ && input.detail != NCursesEvent::USERDEF )
+ {
+ cancel = true;
+ }
+ problemw->setKeyboardFocus();
+ }
+
+ return cancel;
+}
+
+
+bool NCPkgPopupDeps::solve( NCSelectionBox * problemw, NCPkgSolverAction action )
+{
+ if ( !problemw )
+ return false;
+
+ NCDBG << "Solving..." << endl;
+
+ NCPopupInfo * info = new NCPopupInfo( wpos( (NCurses::lines()-4)/2, (NCurses::cols()-18)/2 ),
+ "",
+ NCPkgNames::Solving(),
+ NCPkgNames::OKLabel()
+ );
+ info->setNiceSize( 18, 4 );
+ info->popup();
+
+ zypp::Resolver_Ptr resolver = zypp::getZYpp()->resolver();
+
+ bool success = false;
+ switch ( action )
+ {
+ case S_Solve:
+ success = resolver->resolvePool();
+ break;
+ case S_Verify:
+ success = resolver->verifySystem( true ); // check hardware
+ break;
+ default:
+ NCERR << "Unknown action for resolve" << endl;
+ }
+
+ info->popdown();
+
+ YDialog::deleteTopmostDialog();
+
+ if (success)
+ return true;
+
+ // clear list
+ problems.clear ();
+ problemw->deleteAllItems ();
+
+ zypp::ResolverProblemList rproblems = resolver->problems ();
+ zypp::ResolverProblemList::iterator
+ b = rproblems.begin (),
+ e = rproblems.end (),
+ i;
+ int idx;
+ UIMIL << "PROBLEMS" << endl;
+ for (i = b, idx = 0; i != e; ++i, ++idx)
+ {
+ UIMIL << "PROB " << (*i)->description () << endl;
+ UIMIL << ": " << (*i)->details () << endl;
+
+ // no solution yet
+ problems.push_back (make_pair (*i, zypp::ProblemSolution_Ptr ()));
+ //problemw->itemAdded ((*i)->description (), idx, false /*selected*/);
+ problemw->addItem( (*i)->description(), false ); // selected: false
+ }
+
+ return false;
+}
+
+bool NCPkgPopupDeps::showSolutions( int index )
+{
+ if (!solutionw)
+ return false;
+
+ unsigned int size = problems.size ();
+
+ if ( index < 0 || (unsigned int)index >= size )
+ return false;
+
+ solutionw->startMultipleChanges();
+ solutionw->deleteAllItems();
+
+ zypp::ResolverProblem_Ptr problem = problems[index].first;
+ zypp::ProblemSolution_Ptr user_solution = problems[index].second;
+
+ details->setText( problem->details() );
+
+ zypp::ProblemSolutionList solutions = problem->solutions ();
+ zypp::ProblemSolutionList::iterator
+ bb = solutions.begin (),
+ ee = solutions.end (),
+ ii;
+ for (ii = bb; ii != ee; ++ii) {
+ UIMIL << " SOL " << (*ii)->description () << endl;
+ UIMIL << " : " << (*ii)->details () << endl;
+
+ solutionw->addItem( new YItem ( (*ii)->description(), // label
+ (user_solution == *ii) ) ); // selected
+
+ UIMIL << "usr: " << user_solution << " cur: " << *ii << endl;
+ }
+
+ solutionw->doneMultipleChanges();
+
+ return true;
+}
+
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupDeps::showDependencyPopup
+// METHOD TYPE : void
+//
+// DESCRIPTION :
+//
+NCursesEvent NCPkgPopupDeps::showDependencyPopup( NCPkgSolverAction action )
+{
+ postevent = NCursesEvent();
+
+ do {
+ popupDialog();
+ } while ( postAgain( action ) );
+
+ popdownDialog();
+
+ return postevent;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupDeps::preferredWidth
+// METHOD TYPE : int
+//
+// DESCRIPTION :
+//
+int NCPkgPopupDeps::preferredWidth()
+{
+ return NCurses::cols()-15;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupDeps::preferredHeight
+// METHOD TYPE : int
+//
+// DESCRIPTION :
+//
+int NCPkgPopupDeps::preferredHeight()
+{
+ return NCurses::lines()-5;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPopup::wHandleInput
+// METHOD TYPE : NCursesEvent
+//
+// DESCRIPTION :
+//
+NCursesEvent NCPkgPopupDeps::wHandleInput( wint_t ch )
+{
+ if ( ch == 27 ) // ESC
+ return NCursesEvent::cancel;
+
+ return NCDialog::wHandleInput( ch );
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupDeps::postAgain
+// METHOD TYPE : bool
+//
+// DESCRIPTION :
+//
+bool NCPkgPopupDeps::postAgain( NCPkgSolverAction action )
+{
+ if ( ! postevent.widget )
+ return false;
+
+ if ( postevent.widget == cancelButton )
+ {
+ // close the dialog
+ postevent = NCursesEvent::cancel;
+ }
+ else if ( postevent.widget == solveButton )
+ {
+ // apply the solution here
+ zypp::Resolver_Ptr resolver = zypp::getZYpp()->resolver();
+ ProblemSolutionCorrespondence::iterator
+ b = problems.begin (),
+ e = problems.end (),
+ i;
+ zypp::ProblemSolutionList solutions;
+ for (i = b; i != e; ++i)
+ {
+ // *i is std::pair< zypp::ResolverProblem_Ptr,
+ // zypp::ProblemSolution_Ptr >
+ if (i->second)
+ {
+ solutions.push_back (i->second);
+ }
+ }
+ resolver->applySolutions (solutions);
+
+ // and solve again
+ bool success = solve (problemw, action );
+
+ if ( !success )
+ {
+ problemw->setKeyboardFocus();
+ showSolutions( problemw->getCurrentItem() );
+ }
+ else // everything ok
+ {
+ // close the dialog
+ postevent = NCursesEvent::cancel;
+ }
+ }
+
+ if ( postevent == NCursesEvent::cancel )
+ {
+ // return false means: close the popup dialog
+ return false;
+ }
+ return true;
+}
+
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupDeps::setSolution
+// METHOD TYPE : bool
+//
+// DESCRIPTION :
+//
+void NCPkgPopupDeps::setSolution (int index)
+{
+ // we must search the list :( bad design here
+ // but the solution list is short
+ int prob_num = problemw->getCurrentItem ();
+ zypp::ResolverProblem_Ptr problem = problems[prob_num].first;
+ zypp::ProblemSolution_Ptr sol = zypp::ProblemSolution_Ptr ();
+
+ zypp::ProblemSolutionList solutions = problem->solutions ();
+ zypp::ProblemSolutionList::iterator
+ bb = solutions.begin (),
+ ee = solutions.end (),
+ ii;
+ int idx;
+ for (ii = bb, idx = 0; ii != ee && idx < index; ++ii, ++idx) {
+ //empty
+ }
+ if (ii != ee)
+ sol = *ii;
+
+ problems[prob_num] = make_pair (problem, sol);
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCProblemSelectionBox::wHandleInput
+// METHOD TYPE : NCursesEvent
+//
+// DESCRIPTION :
+//
+NCursesEvent NCProblemSelectionBox::wHandleInput( wint_t key )
+{
+ NCursesEvent ret = NCursesEvent::none;
+
+ // call handleInput of NCPad
+ handleInput( key );
+
+ switch ( key )
+ {
+ case KEY_UP:
+ case KEY_DOWN:
+ case KEY_NPAGE:
+ case KEY_PPAGE:
+ case KEY_END:
+ case KEY_HOME: {
+ // show the corresponding information
+ depsPopup->showSolutions (getCurrentItem ());
+ ret = NCursesEvent::handled;
+ break;
+ }
+ default: {
+//?
+// ret = NCursesEvent::handled;
+ break;
+ }
+ }
+
+ return ret;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCSolutionSelectionBox::wHandleInput
+// METHOD TYPE : NCursesEvent
+//
+// DESCRIPTION :
+//
+NCursesEvent NCSolutionSelectionBox::wHandleInput( wint_t key )
+{
+ NCursesEvent ret = NCMultiSelectionBox::wHandleInput( key );
+
+ switch ( key )
+ {
+ case KEY_SPACE:
+ case KEY_RETURN: {
+ // act like a radio button
+ // make sure that only one item is selected
+ YItem *cur = currentItem ();
+ bool on = isItemSelected( cur );
+ if (on)
+ {
+ deselectAllItems ();
+ selectItem (cur, true);
+ depsPopup->setSolution ( cur->index() );
+ }
+ break;
+ }
+ default: {
+ break;
+ }
+ }
+
+ return ret;
+}
+
Added: branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupDeps.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupDeps.h?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupDeps.h (added)
+++ branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupDeps.h Fri Feb 8 13:59:32 2008
@@ -0,0 +1,115 @@
+/*-----------------------------------------------------------*- c++ -*-\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: NCPkgPopupDeps.h
+
+ Author: Gabriele Strattner
+ Maintainer: Bubli
+
+/-*/
+#ifndef NCPkgPopupDeps_h
+#define NCPkgPopupDeps_h
+
+#include <iosfwd>
+
+#include <vector>
+#include <string>
+
+#include "NCPopup.h"
+#include "NCLabel.h"
+#include
+
+#include "NCZypp.h"
+
+class NCPushButton;
+class NCSelectionBox;
+class NCMultiSelectionBox;
+class NCPackageSelector;
+class NCInputField;
+
+namespace PkgDep {
+ class ErrorResult;
+ class ErrorResultList;
+ class ResultList;
+};
+
+///////////////////////////////////////////////////////////////////
+//
+// CLASS NAME : NCPkgPopupDeps
+//
+// DESCRIPTION :
+//
+class NCPkgPopupDeps : public NCPopup {
+
+ NCPkgPopupDeps & operator=( const NCPkgPopupDeps & );
+ NCPkgPopupDeps ( const NCPkgPopupDeps & );
+
+public:
+ enum NCPkgSolverAction {
+ S_Solve,
+ S_Verify,
+ S_Unknown
+ };
+
+private:
+
+ typedef std::vector > ProblemSolutionCorrespondence;
+ // indexed by widget position,
+ // keeps the user selected solution (or 0) for each problem
+ ProblemSolutionCorrespondence problems;
+
+ NCPushButton * cancelButton;
+ NCPushButton * solveButton;
+
+ NCMultiSelectionBox * solutionw; // resolver problem solutions
+
+ NCLabel * head; // the headline
+
+ NCLabel *details; // problem details
+
+ NCPackageSelector * packager; // connection to the package selector
+
+ void createLayout();
+
+protected:
+
+ NCSelectionBox * problemw; // resolver problems
+
+ virtual bool postAgain( NCPkgSolverAction action );
+
+ virtual NCursesEvent wHandleInput( wint_t ch );
+
+public:
+
+ NCPkgPopupDeps( const wpos at, NCPackageSelector * pkger );
+ virtual ~NCPkgPopupDeps();
+
+ virtual int preferredWidth();
+ virtual int preferredHeight();
+
+ NCursesEvent showDependencyPopup( NCPkgSolverAction action );
+
+ bool showDependencies( NCPkgSolverAction action, bool * ok );
+
+ bool solve( NCSelectionBox * problemw, NCPkgSolverAction action );
+
+ bool showSolutions( int index );
+ // for the currently selected problem, choose this solution
+ void setSolution (int index);
+};
+
+///////////////////////////////////////////////////////////////////
+
+
+#endif // NCPkgPopupDeps_h
Added: branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupDescr.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupDescr.cc?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupDescr.cc (added)
+++ branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupDescr.cc Fri Feb 8 13:59:32 2008
@@ -0,0 +1,238 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: NCPkgPopupDescr.cc
+
+ Author: Gabriele Strattner
+ Maintainer: Michael Andres
+
+/-*/
+#include "Y2Log.h"
+
+
+#include "YMenuButton.h"
+#include "YDialog.h"
+
+#include "NCLayoutBox.h"
+#include "NCSpacing.h"
+#include "NCPkgNames.h"
+#include "NCLabel.h"
+#include "NCPushButton.h"
+#include "NCPkgTable.h"
+#include "NCRichText.h"
+
+#include "NCZypp.h"
+#include "NCi18n.h"
+
+#include "NCPkgPopupDescr.h"
+#include "NCPackageSelector.h"
+
+/*
+ Textdomain "packages"
+*/
+
+using namespace std;
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupDescr::NCPkgPopupDescr
+// METHOD TYPE : Constructor
+//
+// DESCRIPTION :
+//
+NCPkgPopupDescr::NCPkgPopupDescr( const wpos at, NCPackageSelector * pkger )
+ : NCPopup( at, false )
+ , pkgTable( 0 )
+ , okButton( 0 )
+ , headline( 0 )
+ , packager( pkger )
+{
+ createLayout( );
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupDescr::~NCPkgPopupDescr
+// METHOD TYPE : Destructor
+//
+// DESCRIPTION :
+//
+NCPkgPopupDescr::~NCPkgPopupDescr()
+{
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupDescr::createLayout
+// METHOD TYPE : void
+//
+// DESCRIPTION :
+//
+void NCPkgPopupDescr::createLayout( )
+{
+ YWidgetOpt opt;
+
+ // the vertical split is the (only) child of the dialog
+ NCLayoutBox * split = new NCLayoutBox( this, YD_VERT );
+
+ // addChild() is obsolete (handled by new libyui )
+
+ //split->addChild( new NCSpacing( split, opt, 0.8, false, true ) );
+ new NCSpacing( split, YD_VERT, false, 0.8 ); // stretchable = false
+
+ headline = new NCLabel( split, "", true, false ); // isHeading = true
+ //split->addChild( new NCSpacing( split, opt, 0.4, false, true ) );
+ new NCSpacing( split, YD_VERT, false, 0.4 );
+
+ // add the rich text widget for the package description
+ opt.isVStretchable.setValue( true );
+ descrText = new NCRichText( split, "" );
+
+ //split->addChild( new NCSpacing( split, opt, 0.6, false, true ) );
+ new NCSpacing( split, YD_VERT, true, 0.6 ); // stretchable = true
+
+ YTableHeader * tableHeader = new YTableHeader();
+
+ // add the package table (use default type T_Packages)
+ pkgTable = new NCPkgTable( split, tableHeader );
+ pkgTable->setPackager( packager );
+ pkgTable->fillHeader();
+
+ //split->addChild( new NCSpacing( split, opt, 0.6, false, true ) );
+ new NCSpacing( split, YD_VERT, true, 0.6 );
+
+ opt.isHStretchable.setValue( false );
+ //NCLabel * helplb = new NCLabel( split, opt, YCPString(NCPkgNames::DepsHelpLine()) );
+ // a help line for the dependency popup
+ new NCLabel( split, _( " [+] Select [-] Delete [>] Update " ), false, false );
+
+ //split->addChild( new NCSpacing( split, opt, 0.6, false, true ) );
+ new NCSpacing( split, YD_VERT, false, 0.6 ); // stretchable = false
+
+ // add the OK button
+ opt.key_Fxx.setValue( 10 );
+ okButton = new NCPushButton( split, NCPkgNames::OKLabel() );
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupDescr::fillData
+// METHOD TYPE : bool
+//
+// DESCRIPTION :
+//
+bool NCPkgPopupDescr::fillData( ZyppPkg pkgPtr, ZyppSel slbPtr )
+{
+ if ( !pkgPtr )
+ return false;
+
+ pkgTable->itemsCleared(); // clear the table
+
+ pkgTable->createListEntry( pkgPtr, slbPtr );
+
+ pkgTable->drawList();
+
+ headline->setLabel( pkgPtr->summary() );
+
+ descrText->setText( packager->createDescrText(pkgPtr->description()) );
+
+ return true;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupDescr::showInfoPopup
+// METHOD TYPE : NCursesEvent event
+//
+// DESCRIPTION :
+//
+NCursesEvent NCPkgPopupDescr::showInfoPopup( ZyppPkg pkgPtr, ZyppSel slbPtr )
+{
+ postevent = NCursesEvent();
+
+ fillData( pkgPtr, slbPtr );
+
+ do {
+ // show the popup
+ popupDialog( );
+ } while ( postAgain() );
+
+ popdownDialog();
+
+ return postevent;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupDescr::niceSize
+// METHOD TYPE : void
+//
+// DESCRIPTION :
+//
+
+long NCPkgPopupDescr::nicesize(YUIDimension dim)
+{
+ long vdim;
+ if ( NCurses::lines() > 17 )
+ vdim = 17;
+ else
+ vdim = NCurses::lines()-4;
+
+ return ( dim == YD_HORIZ ? NCurses::cols()*2/3 : vdim );
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPopup::wHandleInput
+// METHOD TYPE : NCursesEvent
+//
+// DESCRIPTION :
+//
+NCursesEvent NCPkgPopupDescr::wHandleInput( wint_t ch )
+{
+ if ( ch == 27 ) // ESC
+ return NCursesEvent::cancel;
+
+ if ( ch == KEY_RETURN )
+ return NCursesEvent::button;
+
+ return NCDialog::wHandleInput( ch );
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupDescr::postAgain
+// METHOD TYPE : bool
+//
+// DESCRIPTION :
+//x
+bool NCPkgPopupDescr::postAgain()
+{
+ if ( ! postevent.widget )
+ return false;
+
+ if ( postevent == NCursesEvent::button || postevent == NCursesEvent::cancel )
+ {
+ // return false means: close the popup dialog
+ return false;
+ }
+ return true;
+}
+
Added: branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupDescr.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupDescr.h?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupDescr.h (added)
+++ branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupDescr.h Fri Feb 8 13:59:32 2008
@@ -0,0 +1,79 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: NCPkgPopupDescr.h
+
+ Author: Gabriele Strattner
+ Maintainer: Michael Andres
+
+/-*/
+#ifndef NCPkgPopupDescr_h
+#define NCPkgPopupDescr_h
+
+#include <iosfwd>
+
+#include <vector>
+#include <string>
+
+#include "NCPopup.h"
+
+class NCPkgTable;
+class NCPushButton;
+class NCRichText;
+
+
+///////////////////////////////////////////////////////////////////
+//
+// CLASS NAME : NCPkgPopupDescr
+//
+// DESCRIPTION :
+//
+class NCPkgPopupDescr : public NCPopup {
+
+ NCPkgPopupDescr & operator=( const NCPkgPopupDescr & );
+ NCPkgPopupDescr ( const NCPkgPopupDescr & );
+
+private:
+
+ NCPkgTable * pkgTable;
+ NCPushButton * okButton;
+ NCRichText *descrText;
+ NCLabel *headline;
+
+ NCPackageSelector * packager;
+
+protected:
+
+ virtual bool postAgain();
+
+ virtual NCursesEvent wHandleInput( wint_t ch );
+
+public:
+
+ NCPkgPopupDescr( const wpos at, NCPackageSelector * pkger );
+
+ virtual ~NCPkgPopupDescr();
+
+ virtual long nicesize(YUIDimension dim);
+
+ bool fillData( ZyppPkg pkgPtr, ZyppSel slbPtr );
+
+ void createLayout( );
+
+ NCursesEvent showInfoPopup( ZyppPkg pkgPtr, ZyppSel slbPtr );
+
+};
+
+///////////////////////////////////////////////////////////////////
+
+
+#endif // NCPkgPopupDescr_h
Added: branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupDiskspace.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupDiskspace.cc?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupDiskspace.cc (added)
+++ branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupDiskspace.cc Fri Feb 8 13:59:32 2008
@@ -0,0 +1,540 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: NCPkgPopupDiskspace.cc
+
+ Author: Gabriele Strattner
+ Maintainer: Michael Andres
+
+/-*/
+#include "Y2Log.h"
+
+
+#include "YMenuButton.h"
+#include "YDialog.h"
+#include "YTypes.h"
+
+#include "NCLayoutBox.h"
+#include "NCSpacing.h"
+#include "NCPkgNames.h"
+#include "NCLabel.h"
+#include "NCPushButton.h"
+#include "NCTable.h"
+
+#include "NCZypp.h"
+
+#include "NCPkgPopupDiskspace.h"
+
+#include "NCi18n.h"
+
+using namespace std;
+
+// set values as set in YQPkgDiskUsageList.cc
+#define MIN_FREE_MB_WARN 400
+#define MIN_FREE_MB_PROXIMITY 700
+
+#define MIN_PERCENT_WARN 90
+#define MIN_PERCENT_PROXIMITY 80
+
+#define OVERFLOW_MB_WARN 0
+#define OVERFLOW_MB_PROXIMITY 300
+
+/*
+ Textdomain "packages"
+*/
+
+ ///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupDiskspace::NCPkgPopupDiskspace
+// METHOD TYPE : Constructor
+//
+// DESCRIPTION :
+//
+NCPkgPopupDiskspace::NCPkgPopupDiskspace( const wpos at, bool testMode )
+ : NCPopup( at, false )
+ , partitions( 0 )
+ , okButton( 0 )
+ , testmode( testMode )
+{
+ createLayout( );
+
+ if ( testMode )
+ {
+ NCMIL << "TESTMODE Diskspace" << endl;
+ zypp::getZYpp()->setPartitions(zypp::DiskUsageCounter::detectMountPoints ());
+ testDiskUsage = zypp::getZYpp()->diskUsage();
+ }
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupDiskspace::~NCPkgPopupDiskspace
+// METHOD TYPE : Destructor
+//
+// DESCRIPTION :
+//
+NCPkgPopupDiskspace::~NCPkgPopupDiskspace()
+{
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupDiskspace::createLayout
+// METHOD TYPE : void
+//
+// DESCRIPTION :
+//
+void NCPkgPopupDiskspace::createLayout( )
+{
+ // the vertical split is the (only) child of the dialog
+ NCLayoutBox * split = new NCLayoutBox( this, YD_VERT );
+
+ // addChild() is obsolete (handled by new libyui)
+
+ head = new NCLabel( split, "", true, false ); // isHeading = true
+
+ YTableHeader * tableHeader = new YTableHeader();
+ tableHeader->addColumn( NCPkgNames::Partition(), YAlignBegin );
+ tableHeader->addColumn( NCPkgNames::UsedSpace(), YAlignBegin );
+ tableHeader->addColumn( NCPkgNames::FreeSpace(), YAlignBegin );
+ tableHeader->addColumn( NCPkgNames::TotalSpace(), YAlignBegin );
+ tableHeader->addColumn( "% ", YAlignBegin );
+
+ // add the partition table
+ partitions = new NCTable( split, tableHeader );
+
+ // add the ok button
+ okButton = new NCPushButton( split, NCPkgNames::OKLabel() );
+ okButton->setFunctionKey( 10 );
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupDiskspace::fillPartitionTable
+// METHOD TYPE : void
+//
+// DESCRIPTION :
+//
+void NCPkgPopupDiskspace::fillPartitionTable()
+{
+ partitions->deleteAllItems(); // clear table
+
+ YTableItem * newItem;
+ int i = 0;
+
+ zypp::ZYpp::Ptr z = zypp::getZYpp();
+ zypp::DiskUsageCounter::MountPointSet du = z->diskUsage ();
+ zypp::DiskUsageCounter::MountPointSet::iterator
+ b = du.begin (),
+ e = du.end (),
+ it;
+ if (b == e)
+ {
+ // retry after detecting from the target
+ z->setPartitions(zypp::DiskUsageCounter::detectMountPoints ());
+ du = z->diskUsage();
+ b = du.begin ();
+ e = du.end ();
+ }
+
+ for (it = b; it != e; ++it)
+ {
+ if (it->readonly)
+ continue;
+
+ zypp::ByteCount pkg_used (it->pkg_size * 1024);
+
+ zypp::ByteCount pkg_available ((it->total_size - it->pkg_size) * 1024);
+
+ zypp::ByteCount total (it->total_size * 1024);
+
+ newItem = new YTableItem( it->dir,
+ pkg_used.asString (8),
+ pkg_available.asString (8),
+ total.asString (8),
+ usedPercent( it->pkg_size, it->total_size ) );
+
+ partitions->addItem( newItem );
+
+ i++;
+ }
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupDiskspace::checkDiskSpace
+// METHOD TYPE : string
+//
+// DESCRIPTION :
+//
+string NCPkgPopupDiskspace::checkDiskSpace()
+{
+ string text = "";
+
+ zypp::ZYpp::Ptr z = zypp::getZYpp();
+ zypp::DiskUsageCounter::MountPointSet du = z->diskUsage ();
+ zypp::DiskUsageCounter::MountPointSet::iterator
+ b = du.begin (),
+ e = du.end (),
+ it;
+ if (b == e)
+ {
+ // retry after detecting from the target
+ z->setPartitions(zypp::DiskUsageCounter::detectMountPoints ());
+ du = z->diskUsage();
+ b = du.begin ();
+ e = du.end ();
+ }
+
+ for (it = b; it != e; ++it)
+ {
+ zypp::ByteCount pkg_available = (it->total_size - it->pkg_size) * 1024;
+ if ( pkg_available < 0 )
+ {
+ text += "\"";
+ text += it->dir;
+ text += "\"";
+ text += " ";
+ text += NCPkgNames::MoreText();
+ text += " ";
+ string available = pkg_available.asString();
+ text += available.replace( 0, 1, " " ); // clear the minus sign??
+ text += " ";
+ text += NCPkgNames::MoreSpaceText();
+ text += "<br>";
+ }
+ }
+ return text;
+}
+
+void NCPkgPopupDiskspace::checkRemainingDiskSpace( const ZyppPartitionDu & partition )
+{
+ FSize usedSize ( partition.pkg_size, FSize::K );
+ FSize totalSize ( partition.total_size, FSize::K );
+
+ int percent = 0;
+
+ if ( totalSize != 0 )
+ percent = ( 100 * usedSize ) / totalSize;
+
+ int free = ( totalSize - usedSize ) / FSize::MB;
+
+ NCMIL << "Partition: " << partition.dir << " Used percent: "
+ << percent << " Free: " << free << endl;
+
+ if ( percent > MIN_PERCENT_WARN )
+ {
+ // Modern hard disks can be huge, so a warning based on percentage only
+ // can be misleading - check the absolute value, too.
+ if ( free < MIN_FREE_MB_PROXIMITY )
+ {
+ runningOutWarning.enterProximity();
+ }
+ if ( free < MIN_FREE_MB_WARN )
+ {
+ runningOutWarning.enterRange();
+ }
+ }
+
+ if ( free < MIN_FREE_MB_PROXIMITY )
+ {
+ if ( percent > MIN_PERCENT_PROXIMITY )
+ runningOutWarning.enterProximity();
+ }
+
+ if ( free < OVERFLOW_MB_WARN )
+ overflowWarning.enterRange();
+
+ if ( free < OVERFLOW_MB_PROXIMITY )
+ overflowWarning.enterProximity();
+
+#ifdef TEST
+ NCMIL << "Overflow: " << "_inRange: " << (overflowWarning._inRange?"true":"false") << endl;
+ NCMIL << "Overflow: " << "_isClose: " << (overflowWarning._isClose?"true":"false") << endl;
+ NCMIL << "Overflow: " << "_hasBeenClose: " << (overflowWarning._hasBeenClose?"true":"false") << endl;
+ NCMIL << "Overflow: " << "_warningPosted: " << (overflowWarning._warningPosted?"true":"false") << endl;
+
+ NCMIL << "RunningOut: " << "_inRange: " << (runningOutWarning._inRange?"true":"false") << endl;
+ NCMIL << "RunningOut: " << "_isClose: " << (runningOutWarning._isClose?"true":"false") << endl;
+ NCMIL << "RunningOut: " << "_hasBeenClose: " << (runningOutWarning._hasBeenClose?"true":"false") << endl;
+ NCMIL << "RunningOut: " << "_warningPosted: " << (runningOutWarning._warningPosted?"true":"false") << endl;
+#endif
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupDiskspace::setDiskSpace
+// METHOD TYPE : void
+//
+// DESCRIPTION : for testing only; called from PackageSelector
+// if running in testMode
+//
+void NCPkgPopupDiskspace::setDiskSpace( wint_t ch )
+{
+ int percent = 0;
+
+ // set diskspace values in ZyppDuSet testDiskSpace
+ for ( ZyppDuSetIterator it = testDiskUsage.begin();
+ it != testDiskUsage.end();
+ ++it )
+ {
+ const ZyppPartitionDu & partitionDu = *it;
+
+ FSize usedSize ( partitionDu.pkg_size, FSize::K );
+ FSize totalSize ( partitionDu.total_size, FSize::K );
+
+ if ( totalSize != 0 )
+ percent = ( 100 * usedSize ) / totalSize;
+
+ if ( ch == '+' )
+ percent += 3;
+ else if ( ch == '-' )
+ percent -= 3;
+
+ if ( percent < 0 )
+ percent = 0;
+
+ partitionDu.pkg_size = partitionDu.total_size * percent / 100;
+ }
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupDiskspace::checkDiskSpaceRange
+// METHOD TYPE : void
+//
+// DESCRIPTION :
+//
+void NCPkgPopupDiskspace::checkDiskSpaceRange( )
+{
+ // see YQPkgDiskUsageList::updateDiskUsage()
+ runningOutWarning.clear();
+ overflowWarning.clear();
+ ZyppDuSet diskUsage;
+
+ if ( testmode )
+ diskUsage = testDiskUsage;
+ else
+ diskUsage = zypp::getZYpp()->diskUsage();
+
+ for ( ZyppDuSetIterator it = diskUsage.begin();
+ it != diskUsage.end();
+ ++it )
+ {
+ checkRemainingDiskSpace( *it );
+ }
+
+ // see YQPkgDiskUsageList::postPendingWarnings()
+ if ( overflowWarning.needWarning() )
+ {
+ showInfoPopup( _( "Error: Out of disk space!" ) );
+
+ overflowWarning.warningPostedNotify();
+ runningOutWarning.warningPostedNotify(); // Suppress this ( now redundant ) other warning
+ }
+
+ if ( runningOutWarning.needWarning() )
+ {
+ showInfoPopup( _( "Warning: Disk space is running out!" ) );
+
+ runningOutWarning.warningPostedNotify();
+ }
+
+ if ( overflowWarning.leavingProximity() )
+ overflowWarning.clearHistory();
+
+ if ( runningOutWarning.leavingProximity() )
+ runningOutWarning.clearHistory();
+
+}
+
+string NCPkgPopupDiskspace::usedPercent( FSize used, FSize total )
+{
+ int percent = 0;
+ char percentStr[10];
+
+ if ( total != 0 )
+ percent = ( 100 * used ) / total;
+
+ sprintf( percentStr, "%d%%", percent );
+
+ return percentStr;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupDiskspace::showInfoPopup
+// METHOD TYPE : void
+//
+// DESCRIPTION :
+//
+void NCPkgPopupDiskspace::showInfoPopup( string headline )
+{
+ if ( head )
+ head->setLabel( headline );
+
+ // update values in partition table
+ fillPartitionTable();
+
+ postevent = NCursesEvent();
+ do {
+ // show the popup
+ popupDialog( );
+ } while ( postAgain() );
+
+ popdownDialog();
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupDiskspace::preferredWidth
+// METHOD TYPE : int
+//
+int NCPkgPopupDiskspace::preferredWidth()
+{
+ return NCurses::cols()*2/3;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupDiskspace::preferredHeight
+// METHOD TYPE : int
+//
+int NCPkgPopupDiskspace::preferredHeight()
+{
+ if ( NCurses::lines() > 15 )
+ return 15;
+ else
+ return NCurses::lines()-4;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPopup::wHandleInput
+// METHOD TYPE : NCursesEvent
+//
+// DESCRIPTION :
+//
+NCursesEvent NCPkgPopupDiskspace::wHandleInput( wint_t ch )
+{
+ if ( ch == 27 ) // ESC
+ return NCursesEvent::cancel;
+
+ if ( ch == KEY_RETURN )
+ return NCursesEvent::button;
+
+ return NCDialog::wHandleInput( ch );
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupDiskspace::postAgain
+// METHOD TYPE : bool
+//
+// DESCRIPTION :
+//
+bool NCPkgPopupDiskspace::postAgain()
+{
+ if ( ! postevent.widget )
+ return false;
+
+ if ( postevent == NCursesEvent::button || postevent == NCursesEvent::cancel )
+ {
+ // return false means: close the popup dialog
+ return false;
+ }
+ return true;
+}
+
+
+
+
+NCPkgWarningRangeNotifier::NCPkgWarningRangeNotifier()
+{
+ clearHistory();
+}
+
+
+void
+NCPkgWarningRangeNotifier::clear()
+{
+ _inRange = false;
+ _hasBeenClose = _isClose;
+ _isClose = false;
+}
+
+
+void
+NCPkgWarningRangeNotifier::clearHistory()
+{
+ clear();
+ _hasBeenClose = false;
+ _warningPosted = false;
+}
+
+
+void
+NCPkgWarningRangeNotifier::enterRange()
+{
+ _inRange = true;
+ enterProximity();
+}
+
+
+void
+NCPkgWarningRangeNotifier::enterProximity()
+{
+ _isClose = true;
+ _hasBeenClose = true;
+}
+
+
+void
+NCPkgWarningRangeNotifier::warningPostedNotify()
+{
+ _warningPosted = true;
+}
+
+
+bool
+NCPkgWarningRangeNotifier::inRange() const
+{
+ return _inRange;
+}
+
+
+bool
+NCPkgWarningRangeNotifier::leavingProximity() const
+{
+ return ! _isClose && ! _hasBeenClose;
+}
+
+
+bool
+NCPkgWarningRangeNotifier::needWarning() const
+{
+ return _inRange && ! _warningPosted;
+}
+
+
Added: branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupDiskspace.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupDiskspace.h?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupDiskspace.h (added)
+++ branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupDiskspace.h Fri Feb 8 13:59:32 2008
@@ -0,0 +1,201 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: NCPkgPopupDiskspace.h
+
+ Author: Gabriele Strattner
+ Maintainer: Michael Andres
+
+/-*/
+#ifndef NCPkgPopupDiskspace_h
+#define NCPkgPopupDiskspace_h
+
+#include <iosfwd>
+
+#include <vector>
+#include <string>
+
+#include
+#include "NCPopup.h"
+
+typedef zypp::DiskUsageCounter::MountPoint ZyppPartitionDu;
+typedef zypp::DiskUsageCounter::MountPointSet ZyppDuSet;
+typedef zypp::DiskUsageCounter::MountPointSet::iterator ZyppDuSetIterator;
+
+class NCTable;
+class NCPushButton;
+
+///////////////////////////////////////////////////////////////////////////////
+//
+// CLASS NAME : NCPkgWarningRangeNotifier
+//
+// Class YQPkgWarningRangeNotifier from YQPkgDiskUsageList.h
+//
+
+/**
+ * Helper class to manage warnings that are to be issued when a value enters a
+ * predefined range, but repeated only when that value leaves a (wider)
+ * "proximity" range and then re-enters the (narrower) "inner" range.
+ *
+ * Example: Disk space usage:
+ *
+ * 70%
+ * 75%
+ * 80% [proximity range start]
+ * 85%
+ * 90% [inner range start]
+ * 95%
+ * 100%
+ *
+ * A warning is to be posted when there is only 90% disk space left. After the
+ * warning is displayed, there shall be no more warning until disk usage decreases
+ * below 80% (the proximity range) and then later increases again to 90%.
+ *
+ * The net effect of all that is to avoid posting the warning over and over
+ * again while the value changes back and forth around the boundary of the
+ * ( inner ) warning range.
+ **/
+class NCPkgWarningRangeNotifier
+{
+public:
+
+ /**
+ * Constructor.
+ **/
+ NCPkgWarningRangeNotifier();
+
+ /**
+ * Notification that the inner range is entered.
+ * The caller has to decide the criteria for that.
+ **/
+ void enterRange();
+
+ /**
+ * Notification that the proximity range is entered, i.e. that the value is
+ * getting near the inner range.
+ * 'enterRange()' automatically includes this, too.
+ **/
+ void enterProximity();
+
+ /**
+ * Notification that a warning has been posted.
+ **/
+ void warningPostedNotify();
+
+ /**
+ * Check if the value is in range, i.e. if anybody from the outside has
+ * called 'enterRange()' since the last call to 'clear()'.
+ **/
+ bool inRange() const;
+
+ /**
+ * Check if a warning should be posted, i.e. if the value is currently in
+ * range ( see 'inRange() ) and there has been no notification yet that a
+ * warning has already been posted.
+ **/
+ bool needWarning() const;
+
+ /**
+ * Check if the value is leaving the proximity range.
+ **/
+ bool leavingProximity() const;
+
+ /**
+ * Clear the current values, i.e. prepare for a new round of checks
+ **/
+ void clear();
+
+ /**
+ * Clear everything, including all history values such as if a warning has
+ * been posted.
+ **/
+ void clearHistory();
+
+
+protected:
+
+ bool _inRange;
+ bool _isClose;
+ bool _hasBeenClose;
+ bool _warningPosted;
+};
+
+
+///////////////////////////////////////////////////////////////////
+//
+// CLASS NAME : NCPkgPopupDiskspace
+//
+// DESCRIPTION :
+//
+class NCPkgPopupDiskspace : public NCPopup {
+
+ NCPkgPopupDiskspace & operator=( const NCPkgPopupDiskspace & );
+ NCPkgPopupDiskspace ( const NCPkgPopupDiskspace & );
+
+private:
+
+ NCTable * partitions;
+ NCPushButton * okButton;
+ NCLabel * head;
+ bool testmode;
+ ZyppDuSet testDiskUsage;
+
+ string usedPercent( FSize used, FSize total );
+
+ /**
+ * Warning range notifier about running out of disk space warning.
+ **/
+ NCPkgWarningRangeNotifier runningOutWarning;
+
+ /**
+ * Warning range notifier about disk space overflow warning.
+ **/
+ NCPkgWarningRangeNotifier overflowWarning;
+
+protected:
+
+ virtual bool postAgain();
+
+ virtual NCursesEvent wHandleInput( wint_t ch );
+
+public:
+
+ NCPkgPopupDiskspace( const wpos at, bool testSpaceMode );
+
+ virtual ~NCPkgPopupDiskspace();
+
+ virtual int preferredWidth();
+ virtual int preferredHeight();
+
+ void fillPartitionTable();
+
+ string checkDiskSpace();
+
+ void setDiskSpace( wint_t key ); // used for testing
+
+ void checkDiskSpaceRange( );
+
+ void createLayout( );
+
+ void showInfoPopup( string headline );
+
+ void checkRemainingDiskSpace( const ZyppPartitionDu & partition );
+};
+
+
+
+
+
+///////////////////////////////////////////////////////////////////
+
+
+#endif // NCPkgPopupDiskspace_h
Added: branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupRepo.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupRepo.cc?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupRepo.cc (added)
+++ branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupRepo.cc Fri Feb 8 13:59:32 2008
@@ -0,0 +1,429 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: NCPkgPopupRepo.cc
+
+ Author: Bubli
+
+/-*/
+
+#include "Y2Log.h"
+#include "NCPkgPopupRepo.h"
+
+#include "YDialog.h"
+#include "NCLayoutBox.h"
+#include "NCSpacing.h"
+#include "NCPkgNames.h"
+
+#include "NCZypp.h"
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgRepoTag::NCPkgRepoTag
+// METHOD TYPE : Constructor
+//
+// DESCRIPTION :
+//
+
+NCPkgRepoTag::NCPkgRepoTag ( ZyppRepo repoPtr)
+ : YTableCell(string(" "))
+ //: NCTableCol (NCstring(" "), SEPARATOR)
+ , repo (repoPtr)
+{
+
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgRepoTable::NCPkgRepoTable
+// METHOD TYPE : Constructor
+//
+// DESCRIPTION :
+//
+
+NCPkgRepoTable::NCPkgRepoTable( YWidget *parent, YTableHeader *tableHeader )
+ :NCTable( parent, tableHeader )
+{
+ fillHeader();
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgRepoTable::fillHeader
+// METHOD TYPE : void
+//
+// DESCRIPTION : Fill header of repositories table (name + URL)
+//
+
+void NCPkgRepoTable::fillHeader()
+{
+ vector <string> header;
+
+ header.reserve(3);
+ header.push_back( "L" );
+ header.push_back( "L" + NCPkgNames::PkgName() );
+ header.push_back( "L" + NCPkgNames::RepoURL() );
+
+ setHeader( header);
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgRepoTable::addLine
+// METHOD TYPE : void
+//
+// DESCRIPTION : Add one line (with tag) to the repository table
+//
+
+void NCPkgRepoTable::addLine ( ZyppRepo r, const vector <string> & cols )
+{
+ //use default ctor, add cell in the next step
+ YTableItem *tabItem = new YTableItem();
+
+ //place tag (with repo reference) to the 0th column
+ tabItem->addCell( new NCPkgRepoTag ( r ) );
+
+ // and append the rest (name, URL and stuff)
+ for ( unsigned i = 1; i < cols.size() + 1; ++i ) {
+ tabItem->addCell( cols[ i-1 ]);
+ }
+
+ // this is NCTable::addItem( tabItem );
+ //it actually appends the line to the table
+ addItem( tabItem );
+
+
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgRepoTable::getTag
+// METHOD TYPE : NCPkgRepoTag *
+//
+// DESCRIPTION : Get tag of repository table line on current index,
+// ( contains repository reference)
+//
+
+NCPkgRepoTag* NCPkgRepoTable::getTag (const int & index )
+{
+ NCTableLine *line = myPad()->ModifyLine( index );
+ if ( !line )
+ {
+ return 0;
+ }
+
+ YTableItem *it = dynamic_cast (line->origItem() );
+
+ //get actual repo tag from 0th column of the table
+ YTableCell *tcell = it->cell(0);
+ NCPkgRepoTag *tag = static_cast( tcell );
+
+ return tag;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgRepoTable::getRepo
+// METHOD TYPE : ZyppRepo
+//
+// DESCRIPTION : Get repository reference from selected line's tag
+//
+
+ZyppRepo NCPkgRepoTable::getRepo( int index )
+{
+ NCPkgRepoTag *t = getTag( index );
+
+ if ( !t )
+ {
+ return ZyppRepo( );
+ }
+ else
+ {
+ return t->getRepo();
+ }
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupRepo::NCPkgPopupRepo
+// METHOD TYPE : Constructor
+//
+// DESCRIPTION :
+//
+
+NCPkgPopupRepo::NCPkgPopupRepo (const wpos at, NCPackageSelector *pkg)
+ : NCPopup (at, false)
+ , repolist( 0 )
+ , okButton( 0 )
+ , packager( pkg )
+{
+ createLayout( NCPkgNames::RepoLabel() );
+
+ fillRepoList( );
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupRepo::~NCPkgPopupRepo
+// METHOD TYPE : Destructor
+//
+// DESCRIPTION :
+//
+
+NCPkgPopupRepo::~NCPkgPopupRepo()
+{
+ //NOP
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupRepo::createLayout
+// METHOD TYPE : void
+//
+// DESCRIPTION : Create visual layout of the popup window
+// (header label, NCPkgRepoTable, OK button)
+//
+
+void NCPkgPopupRepo::createLayout( const string & label)
+{
+
+ // the vertical split is the (only) child of the dialog
+ NCLayoutBox * split = new NCLayoutBox( this, YD_VERT );
+
+ //the headline
+ new NCLabel( split, label, true, false );
+
+ // the repositories table
+ YTableHeader *tableHeader = new YTableHeader();
+ repolist = new NCPkgRepoTable( split, tableHeader );
+ repolist->fillHeader();
+
+ new NCSpacing( split, YD_VERT, false, 0.4 );
+
+ //the cute button
+ okButton = new NCPushButton( split, NCPkgNames::OKLabel() );
+ okButton->setFunctionKey(10);
+
+ new NCSpacing( split, YD_VERT, false, 0.4 );
+
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupRepo::fillRepoList
+// METHOD TYPE : bool
+//
+// DESCRIPTION : Add items to the repository list (assoc.
+// product name, if any, and URL)
+//
+
+bool NCPkgPopupRepo::fillRepoList()
+{
+ NCMIL << "Filling repository list" << endl;
+
+ vector <string> oneLine;
+
+ //iterate through all repositories
+ for ( ZyppRepositoryIterator it = ZyppRepositoriesBegin();
+ it != ZyppRepositoriesEnd();
+ ++it)
+ {
+ oneLine.clear();
+
+ // let's find some product for this repository
+ // but not now :) bug #296782
+ //ZyppProduct product = findProductForRepo( (*it) );
+ //if ( product )
+ //{
+ // name = product->summary();
+ //}
+ string name = (*it).info().name();
+
+ oneLine.push_back( name );
+
+ //and URL as well
+ zypp::Url srcUrl;
+ if ( ! (*it).info().baseUrlsEmpty() )
+ srcUrl = *(*it).info().baseUrlsBegin();
+
+ oneLine.push_back( srcUrl.asString() );
+ //add the whole stuff to the table
+ repolist->addLine( (*it), oneLine);
+ }
+
+ return true;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupRepo::findProductForRepo
+// METHOD TYPE : ZyppProduct
+//
+// DESCRIPTION : Find single zypp::Product for this repository
+// (null product if multiple products found)
+//
+
+ZyppProduct NCPkgPopupRepo::findProductForRepo( ZyppRepo repo)
+{
+
+ ZyppProduct product;
+
+ zypp::ResStore::iterator it = repo.resolvables().begin();
+
+ while( it != repo.resolvables().end() && !product )
+ {
+ //Single product - most common case
+ product = zypp::dynamic_pointer_castzypp::Product( *it );
+ it++;
+ }
+
+ while ( it != repo.resolvables().end() )
+ {
+ if ( zypp::dynamic_pointer_castzypp::Product( *it ) )
+ {
+ //Aw, multiple product found, we don't want those
+ NCWAR << "Multiple products in repository " <<
+ repo.info().alias().c_str() << endl;
+ ZyppProduct null;
+ return null;
+ }
+
+ ++it;
+ }
+
+ if ( !product )
+ {
+ //bad luck, nothing found
+ NCMIL << "No product in repository " <<
+ repo.info().alias().c_str() << endl;
+ }
+
+ return product;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupRepo::nicesize
+// METHOD TYPE : long
+//
+// DESCRIPTION : default boring setting nice size
+//
+
+int NCPkgPopupRepo::preferredWidth()
+{
+ return NCurses::cols()*2/3;
+}
+
+int NCPkgPopupRepo::preferredHeight()
+{
+ if ( NCurses::lines() > 20 )
+ return 20;
+ else
+ return NCurses::lines()-4;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupRepo::wHandleInput
+// METHOD TYPE : NCursesEvent
+//
+// DESCRIPTION : default boring handle-input
+//
+
+NCursesEvent NCPkgPopupRepo::wHandleInput( wint_t ch )
+{
+ if ( ch == 27 ) // ESC
+ return NCursesEvent::cancel;
+
+ return NCDialog::wHandleInput( ch );
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupRepo::postAgain
+// METHOD TYPE : bool
+//
+// DESCRIPTION : default boring postAgain
+//
+
+bool NCPkgPopupRepo::postAgain()
+{
+ if( !postevent.widget )
+ return false;
+
+ postevent.detail = NCursesEvent::NODETAIL;
+
+ if ( postevent.widget == okButton )
+ {
+ postevent.detail = NCursesEvent::USERDEF ;
+ // return false means: close the popup
+ return false;
+ }
+
+ if (postevent == NCursesEvent::cancel)
+ return false;
+
+ return true;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupRepo::showRepoPopup
+// METHOD TYPE : NCursesEvent &
+//
+// DESCRIPTION : Do actual work - show popup to the user,
+// collect packages for selected repository
+// (calls NCPackageSelector::fillRepoFilterList)
+//
+
+NCursesEvent & NCPkgPopupRepo::showRepoPopup()
+{
+ postevent = NCursesEvent();
+
+ if (!repolist)
+ return postevent;
+
+ do {
+ popupDialog();
+ } while ( postAgain() );
+
+ popdownDialog();
+
+ if ( postevent.detail == NCursesEvent::USERDEF )
+ {
+ //get current table line and its repository reference
+ int index = repolist->getCurrentItem();
+ ZyppRepo repo = repolist->getRepo( index );
+
+ NCMIL << "Selected repository " << repo.info().alias().c_str() << endl;
+
+ //and show associated packages to the user
+ packager->fillRepoFilterList( repo );
+
+ }
+ return postevent;
+}
Added: branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupRepo.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupRepo.h?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupRepo.h (added)
+++ branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupRepo.h Fri Feb 8 13:59:32 2008
@@ -0,0 +1,181 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: NCPkgPopupRepo.h
+
+ Author: Bubli
+
+/-*/
+
+#ifndef NCPkgPopupRepo_h
+#define NCPKGPopupRepo_h
+
+#include <iosfwd>
+
+#include <vector>
+#include <string>
+#include <algorithm>
+
+#include "NCPadWidget.h"
+#include "NCPopup.h"
+#include "NCPushButton.h"
+#include "NCTable.h"
+#include "NCTablePad.h"
+#include "NCPackageSelector.h"
+
+class NCPopup;
+class NCPushButton;
+class NCPackageSelector;
+
+class NCPkgRepoTag : public YTableCell
+{
+
+private:
+
+ ZyppRepo repo;
+
+public:
+ /**
+ * A helper class to hold a reference to zypp::Repository
+ * for each repository table line
+ * (actually it's a dummy column of the table)
+ * @param repo zypp::Repository reference
+ */
+
+ NCPkgRepoTag ( ZyppRepo repo);
+
+ //Nikdy, ale opravdu nikdy nenechavej v odvozene tride virtualni
+ //destruktor, kdyz ani v puvodni neni, Bublino!
+ ~NCPkgRepoTag() { NCINT << "au!!!!" << endl; };
+
+ /*
+ * Get repository reference from the line tag
+ * @return ZyppRepo
+ */
+
+ ZyppRepo getRepo() const { return repo; }
+
+};
+
+class NCPkgRepoTable : public NCTable
+{
+private:
+
+ NCPkgRepoTable & operator=( const NCPkgRepoTable & );
+ NCPkgRepoTable ( const NCPkgRepoTable & );
+
+public:
+
+ /**
+ * A helper class to hold repository data in a neat table
+ * widget
+ * @param parent A parent widget
+ * @param opt Widget options
+ */
+
+ NCPkgRepoTable ( YWidget *parent, YTableHeader *tableHeader);
+
+ virtual ~NCPkgRepoTable() {};
+
+ /**
+ * Add one line (with tag) to the repositories table
+ * @param ZyppRepo Reference to zypp::Repository
+ * @param cols String vector with repository data (name + URL)
+ */
+ virtual void addLine( ZyppRepo r, const vector<string> & cols );
+
+ /*
+ * Fill header of repositories table (name + URL)
+ */
+ void fillHeader();
+
+ /**
+ * Get tag of repository table line on current index,
+ * ( contains repository reference)
+ * @param index Index of selected table line
+ * @return NCPkgRepoTag* Tag of selected line
+ */
+ NCPkgRepoTag * getTag ( const int & index );
+
+ /**
+ * Get repository reference from selected line's tag
+ * @param index Index of selected table line
+ * @return ZyppRepo Associated zypp::Repository reference
+ */
+ ZyppRepo getRepo( int index );
+
+};
+
+class NCPkgPopupRepo : public NCPopup {
+
+ NCPkgPopupRepo & operator=( const NCPkgPopupRepo & );
+ NCPkgPopupRepo ( const NCPkgPopupRepo &);
+
+private:
+ NCPkgRepoTable *repolist;
+ NCPushButton *okButton;
+ NCPackageSelector *packager;
+
+protected:
+
+ virtual bool postAgain();
+
+ virtual NCursesEvent wHandleInput ( wint_t ch );
+
+public:
+ /**
+ * Repository table popup class, holds repository table data,
+ * creates layout, processes user input
+ * @param at Where to draw the popup
+ * @param pkger Connection to package selector
+ */
+ NCPkgPopupRepo ( const wpos at, NCPackageSelector *pkger);
+
+ virtual ~NCPkgPopupRepo();
+
+ /**
+ * Find single zypp::Product for this repository
+ * (null product if multiple products found)
+ * @param repo zypp::Repository
+ * @return ZyppProduct
+ */
+
+ ZyppProduct findProductForRepo (ZyppRepo repo);
+
+ virtual int preferredWidth();
+
+ virtual int preferredHeight();
+
+ /**
+ * Create visual layout of the popup window
+ * (header label, NCPkgRepoTable, OK button)
+ * @param label Header label
+ */
+
+ void createLayout( const string & label );
+
+ /**
+ * Add items to the repository list (assoc.
+ * product name, if any, and URL)
+ * @return bool (always true ;-) )
+ */
+ bool fillRepoList( );
+
+ /**
+ * Do actual work - show popup to the user,
+ * collect packages for selected repository
+ * (calls NCPackageSelector::fillRepoFilterList)
+ * @return NCursesEvent
+ */
+ NCursesEvent & showRepoPopup();
+};
+#endif
Added: branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupSearch.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupSearch.cc?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupSearch.cc (added)
+++ branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupSearch.cc Fri Feb 8 13:59:32 2008
@@ -0,0 +1,324 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: NCPkgPopupSearch.cc
+
+ Author: Gabriele Strattner
+ Maintainer: Michael Andres
+
+/-*/
+#include "Y2Log.h"
+#include "NCPkgPopupSearch.h"
+
+#include "NCTree.h"
+#include "YMenuButton.h"
+#include "YDialog.h"
+#include "NCLayoutBox.h"
+#include "NCSpacing.h"
+#include "NCFrame.h"
+
+#include "NCPkgNames.h"
+#include "NCPackageSelector.h"
+
+#include "NCi18n.h"
+
+/*
+ Textdomain "packages"
+*/
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupSearch::NCPkgPopupSearch
+// METHOD TYPE : Constructor
+//
+// DESCRIPTION :
+//
+NCPkgPopupSearch::NCPkgPopupSearch( const wpos at, NCPackageSelector * pkger )
+ : NCPopup( at, false )
+ , searchExpr( 0 )
+ , ignoreCase( 0 )
+ , checkName( 0 )
+ , checkSummary( 0 )
+ , checkDescr( 0 )
+ , checkProvides( 0 )
+ , checkRequires( 0 )
+ , cancelButton( 0 )
+ , packager( pkger )
+{
+ if ( !packager->isYouMode() )
+ createLayout( _( "Package Search" ) );
+ else
+ createLayout( _("Search for Patch Name") );
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupSearch::~NCPkgPopupSearch
+// METHOD TYPE : Destructor
+//
+// DESCRIPTION :
+//
+NCPkgPopupSearch::~NCPkgPopupSearch()
+{
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupSearch::createLayout
+// METHOD TYPE : void
+//
+// DESCRIPTION :
+//
+void NCPkgPopupSearch::createLayout( const string & headline )
+{
+ // vertical split is the (only) child of the dialog
+ NCLayoutBox * vSplit = new NCLayoutBox( this, YD_VERT );
+
+ // addChild() is obsolete
+
+ new NCSpacing( vSplit, YD_VERT, false, 0.8 ); // stretchable = false
+
+ new NCLabel( vSplit, headline, true, false ); // isHeading = true
+
+ new NCSpacing( vSplit, YD_VERT, false, 0.6 );
+
+ NCFrame * frame0 = new NCFrame( vSplit, "" );
+
+ // add the input field (a editable combo box)
+ searchExpr = new NCComboBox( frame0,
+ NCPkgNames::SearchPhrase(),
+ true ); // editable = true
+
+ searchExpr->setStretchable( YD_HORIZ, true );
+
+ searchExpr->addItem( new YTableItem() );
+
+ new NCSpacing( vSplit, YD_VERT, false, 0.6 );
+
+ if ( !packager->isYouMode() )
+ {
+ // add the checkBox ignore case
+ NCLayoutBox * hSplit2 = new NCLayoutBox( vSplit, YD_HORIZ );
+ new NCSpacing( hSplit2, YD_HORIZ, true, 0.1 );
+
+ ignoreCase = new NCCheckBox( hSplit2, NCPkgNames::IgnoreCase(), true ); // checked = true
+ new NCSpacing( vSplit, YD_VERT, false, 0.6 );
+
+ // label of a frame in search popup (without hotkey)
+ NCFrame * frame = new NCFrame( vSplit, _( " Search in " ) );
+ NCLayoutBox * vSplit3 = new NCLayoutBox( frame, YD_VERT );
+
+ checkName = new NCCheckBox( vSplit3, NCPkgNames::CheckName(), true );
+ checkName->setStretchable(YD_HORIZ, true );
+
+ checkSummary = new NCCheckBox( vSplit3, NCPkgNames::CheckSummary(), true );
+ checkSummary->setStretchable(YD_HORIZ, true );
+
+ checkDescr = new NCCheckBox( vSplit3, NCPkgNames::CheckDescr(), false );
+ checkDescr->setStretchable(YD_HORIZ, true );
+
+ checkProvides = new NCCheckBox( vSplit3, NCPkgNames::CheckProvides(), false );
+ checkProvides->setStretchable(YD_HORIZ, true );
+
+ checkRequires = new NCCheckBox( vSplit3, NCPkgNames::CheckRequires(), false );
+ checkRequires->setStretchable(YD_HORIZ, true );
+
+ new NCSpacing( vSplit, YD_VERT, false, 0.8 );
+ }
+
+ NCLayoutBox * hSplit3 = new NCLayoutBox( vSplit, YD_HORIZ );
+
+ new NCSpacing( hSplit3, YD_HORIZ, true, 0.2 );
+
+ // add the cancel and the ok button
+ okButton = new NCPushButton( hSplit3, NCPkgNames::OKLabel() );
+ okButton->setFunctionKey( 10 );
+
+ new NCSpacing( hSplit3, YD_HORIZ, true, 0.4 );
+
+ cancelButton = new NCPushButton( hSplit3, NCPkgNames::CancelLabel() );
+ cancelButton->setFunctionKey( 9 );
+
+ new NCSpacing( hSplit3, YD_HORIZ, true, 0.2 );
+
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupSearch::showSearchPopup
+// METHOD TYPE : void
+//
+// DESCRIPTION :
+//
+NCursesEvent & NCPkgPopupSearch::showSearchPopup( )
+{
+ postevent = NCursesEvent();
+ do {
+ popupDialog();
+ if ( searchExpr )
+ {
+ searchExpr->setKeyboardFocus();
+ }
+ } while ( postAgain() );
+
+ popdownDialog();
+
+ return postevent;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// DESCRIPTION :
+//
+string NCPkgPopupSearch::getSearchExpression() const
+{
+ string value;
+ unsigned int i = 0;
+
+ if ( searchExpr )
+ {
+ // get the expression and store it in combo box list
+ // value = searchExpr->getValue();
+
+ value = searchExpr->text();
+ i = searchExpr->getListSize();
+#if 0
+ searchExpr->itemAdded( value, // the search expression
+ i, // index
+ true ); // selected
+#endif
+ searchExpr->addItem( value, true );
+ }
+
+ return value;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupSearch::niceSize
+// METHOD TYPE : void
+//
+// DESCRIPTION :
+//
+long NCPkgPopupSearch::nicesize(YUIDimension dim)
+{
+ long vdim;
+
+ if ( !packager->isYouMode() )
+ {
+ if ( NCurses::lines() > 20 )
+ vdim = 20;
+ else
+ vdim = NCurses::lines()-4;
+ }
+ else
+ {
+ vdim = 10;
+ }
+
+ return ( dim == YD_HORIZ ? NCurses::cols()/2 : vdim );
+}
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPopup::wHandleInput
+// METHOD TYPE : NCursesEvent
+//
+// DESCRIPTION :
+//
+NCursesEvent NCPkgPopupSearch::wHandleInput( wint_t ch )
+{
+ if ( ch == 27 ) // ESC
+ return NCursesEvent::cancel;
+
+ // start package search if Return is pressed
+ if ( ch == KEY_RETURN )
+ return NCursesEvent::button;
+
+ return NCDialog::wHandleInput( ch );
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupSearch::postAgain
+// METHOD TYPE : bool
+//
+// DESCRIPTION :
+//
+bool NCPkgPopupSearch::postAgain()
+{
+ if ( ! postevent.widget )
+ return false;
+
+ postevent.result = "";
+
+ if ( postevent.widget == cancelButton )
+ {
+ postevent = NCursesEvent::cancel;
+ }
+ else if ( postevent == NCursesEvent::button )
+ {
+ // get the search expression
+ postevent.result = getSearchExpression();
+
+ string filter = postevent.result;
+
+ if ( !packager->isYouMode() )
+ {
+ // fill the package list with packages matching the search expression
+ packager->fillSearchList( filter,
+ getCheckBoxValue( ignoreCase ),
+ getCheckBoxValue( checkName ),
+ getCheckBoxValue( checkSummary ),
+ getCheckBoxValue( checkDescr ),
+ getCheckBoxValue( checkProvides ),
+ getCheckBoxValue( checkRequires )
+ );
+ }
+ else
+ {
+ packager->fillPatchSearchList( filter );
+ }
+ }
+
+ if ( postevent == NCursesEvent::button || postevent == NCursesEvent::cancel )
+ {
+ // return false means: close the popup dialog
+ return false;
+ }
+ return true;
+}
+
+bool NCPkgPopupSearch::getCheckBoxValue( NCCheckBox * checkBox )
+{
+ //YCPValue value = YCPNull();
+ YCheckBoxState value = YCheckBox_off;
+
+ if ( checkBox )
+ {
+ value = checkBox->value();
+
+ // return whether the option is selected or not
+ //if ( !value.isNull() )
+ // return ( value->asBoolean()->toString() == "true" ? true : false );
+
+ return ( value == YCheckBox_on ? true : false );
+ }
+
+ return false;
+}
Added: branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupSearch.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupSearch.h?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupSearch.h (added)
+++ branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupSearch.h Fri Feb 8 13:59:32 2008
@@ -0,0 +1,89 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: NCPkgPopupSearch.h
+
+ Author: Gabriele Strattner
+ Maintainer: Michael Andres
+
+/-*/
+#ifndef NCPkgPopupSearch_h
+#define NCPkgPopupSearch_h
+
+#include <iosfwd>
+
+#include <vector>
+#include <string>
+using namespace std;
+
+#include "NCPopup.h"
+#include "NCComboBox.h"
+#include "NCLabel.h"
+#include "NCRichText.h"
+#include "NCCheckBox.h"
+#include "NCPushButton.h"
+
+class NCPackageSelector;
+
+///////////////////////////////////////////////////////////////////
+//
+// CLASS NAME : NCPkgPopupSearch
+//
+// DESCRIPTION :
+//
+class NCPkgPopupSearch : public NCPopup {
+
+ NCPkgPopupSearch & operator=( const NCPkgPopupSearch & );
+ NCPkgPopupSearch ( const NCPkgPopupSearch & );
+
+private:
+
+ NCComboBox * searchExpr;
+ NCCheckBox * ignoreCase;
+ NCCheckBox * checkName;
+ NCCheckBox * checkSummary;
+ NCCheckBox * checkDescr;
+ NCCheckBox * checkProvides;
+ NCCheckBox * checkRequires;
+
+ NCPushButton * cancelButton;
+ NCPushButton * okButton;
+
+ NCPackageSelector * packager; // connection to the package selector
+
+ bool getCheckBoxValue( NCCheckBox * checkBox );
+
+protected:
+
+ string getSearchExpression() const;
+
+ virtual bool postAgain();
+
+ virtual NCursesEvent wHandleInput( wint_t ch );
+
+public:
+
+ NCPkgPopupSearch( const wpos at, NCPackageSelector *pkger );
+ virtual ~NCPkgPopupSearch();
+
+ virtual long nicesize(YUIDimension dim);
+
+ void createLayout( const string & headline );
+
+ NCursesEvent & showSearchPopup( );
+
+};
+
+///////////////////////////////////////////////////////////////////
+
+
+#endif // NCPkgPopupSearch_h
Added: branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupSelection.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupSelection.cc?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupSelection.cc (added)
+++ branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupSelection.cc Fri Feb 8 13:59:32 2008
@@ -0,0 +1,477 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: NCPkgPopupSelection.cc
+
+ Author: Gabriele Strattner
+ Maintainer: Michael Andres
+
+/-*/
+#include "Y2Log.h"
+#include "NCPkgPopupSelection.h"
+
+#include "YDialog.h"
+#include "NCLayoutBox.h"
+#include "NCSpacing.h"
+#include "NCPkgNames.h"
+#include "NCPkgTable.h"
+#include "NCPkgStatusStrategy.h"
+#include
+
+#include "NCZypp.h"
+#include "NCi18n.h"
+
+#ifdef FIXME
+#define LOCALE Y2PM::getPreferredLocale()
+#else
+#define LOCALE
+#endif
+
+/*
+ Textdomain "packages"
+*/
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupSelection::NCPkgPopupSelection
+// METHOD TYPE : Constructor
+//
+// DESCRIPTION :
+//
+NCPkgPopupSelection::NCPkgPopupSelection( const wpos at, NCPackageSelector * pkg, SelType type )
+ : NCPopup( at, false )
+ , sel( 0 )
+ , okButton( 0 )
+ , packager( pkg )
+ , type( type )
+{
+ switch ( type )
+ {
+ case S_Pattern:
+ case S_Selection: {
+ createLayout( NCPkgNames::SelectionLabel() );
+ break;
+ }
+ case S_Language: {
+ createLayout( NCPkgNames::LanguageLabel() );
+ break;
+ }
+ default:
+ break;
+ }
+
+
+ fillSelectionList( sel, type );
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupSelection::~NCPkgPopupSelection
+// METHOD TYPE : Destructor
+//
+// DESCRIPTION :
+//
+NCPkgPopupSelection::~NCPkgPopupSelection()
+{
+
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupSelection::createLayout
+// METHOD TYPE : void
+//
+// DESCRIPTION :
+//
+void NCPkgPopupSelection::createLayout( const string & label )
+{
+ // the vertical split is the (only) child of the dialog
+ NCLayoutBox * split = new NCLayoutBox( this, YD_VERT );
+
+ // addChild( ) is obsolete (handled by new libyui)
+
+ new NCLabel( split, label, true, false ); // isHeading = true
+ YTableHeader * tableHeader = new YTableHeader();
+
+ // add the selection list
+ sel = new NCPkgTable( split, tableHeader );
+ sel->setPackager( packager );
+
+ // set status strategy
+ NCPkgStatusStrategy * strat = new SelectionStatStrategy();
+
+ switch (type) {
+ case S_Pattern:
+ case S_Selection: {
+ sel->setTableType( NCPkgTable::T_Selections, strat );
+ break;
+ }
+ case S_Language: {
+ sel->setTableType( NCPkgTable::T_Languages, strat );
+ break;
+ }
+ default: {
+ NCERR << "Unknown selection type" << endl;
+ break;
+ }
+ }
+
+ sel->fillHeader();
+
+ // a help line for the selction/pattern/language popup
+ new NCLabel( split, _( " [+] Select [-] Delete [>] Update " ), false, false );
+
+ new NCSpacing( split, YD_VERT, false, 0.4 );
+
+ // add an OK button
+ okButton = new NCPushButton( split, NCPkgNames::OKLabel() );
+ okButton->setFunctionKey(10);
+
+ new NCSpacing( split, YD_VERT, false, 0.4 );
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// NCursesEvent & showSelectionPopup ()
+//
+//
+NCursesEvent & NCPkgPopupSelection::showSelectionPopup( )
+{
+ postevent = NCursesEvent();
+
+ if ( !sel )
+ return postevent;
+
+ sel->updateTable();
+ sel->setKeyboardFocus();
+
+ // event loop
+ do {
+ popupDialog();
+ } while ( postAgain() );
+
+ popdownDialog();
+
+ if ( !packager )
+ return postevent;
+
+ // if OK is clicked get the current item and show the package list
+ if ( postevent.detail == NCursesEvent::USERDEF )
+ {
+ int index = sel->getCurrentItem();
+ ZyppObj objPtr = sel->getDataPointer( index );
+ if ( objPtr )
+ {
+ NCMIL << "Current selection: " << getCurrentLine() << endl;
+
+ // show the package list
+ std::setstd::string packages;
+ ZyppSelection selPtr = tryCastToZyppSelection (objPtr);
+ ZyppPattern patPtr = tryCastToZyppPattern (objPtr);
+ ZyppLang langPtr = tryCastToZyppLang (objPtr);
+ if (selPtr)
+ packages = selPtr->install_packages ();
+ else if (patPtr)
+ {
+ zypp::ui::PatternContents patternContents( patPtr );
+ packages = patternContents.install_packages();
+ }
+ else if (langPtr)
+ {
+ string currentLang = langPtr->name();
+
+ for ( ZyppPoolIterator it = zyppPkgBegin(); it != zyppPkgEnd(); ++it )
+ {
+ ZyppObj zyppObj = (*it)->theObj();
+
+ if ( zyppObj )
+ {
+ //find all 'freshens' dependencies of this object
+ zypp::CapSet freshens = zyppObj->dep( zypp::Dep::FRESHENS );
+
+ for ( zypp::CapSet::const_iterator cap_it = freshens.begin();
+ cap_it != freshens.end();
+ ++cap_it )
+ {
+ if ( (*cap_it).index() == currentLang ) // obj freshens this language
+ {
+ ZyppPkg pkg = tryCastToZyppPkg( zyppObj );
+
+ if ( pkg )
+ {
+ NCDBG << "Found pkg " << pkg->name().c_str() << "for lang "
+ << currentLang.c_str() << endl;
+
+ packages.insert( pkg->name() );
+ }
+ }
+ }
+ }
+ }
+
+ }
+
+ packager->showSelPackages( getCurrentLine(), packages );
+ // showDiskSpace() moved to NCPkgTable.cc (show/check diskspace
+ // on every status change)
+ // packager->showDiskSpace();
+ }
+ }
+
+ return postevent;
+}
+
+
+//////////////////////////////////////////////////////////////////
+//
+// getCurrentLine()
+//
+// returns the currently selected list item (may be "really" selected
+// or not)
+//
+string NCPkgPopupSelection::getCurrentLine( )
+{
+ if ( !sel )
+ return "";
+
+ int index = sel->getCurrentItem();
+ ZyppObj selPtr = sel->getDataPointer(index);
+
+ return ( selPtr?selPtr->summary(LOCALE):"" );
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupSelection::preferredWidth
+// METHOD TYPE : int
+//
+int NCPkgPopupSelection::preferredWidth()
+{
+ return NCurses::cols()*2/3;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupSelection::preferredHeight
+// METHOD TYPE : int
+//
+int NCPkgPopupSelection::preferredHeight()
+{
+ if ( NCurses::lines() > 20 )
+ return 20;
+ else
+ return NCurses::lines()-4;
+}
+
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPopup::wHandleInput
+// METHOD TYPE : NCursesEvent
+//
+// DESCRIPTION :
+//
+NCursesEvent NCPkgPopupSelection::wHandleInput( wint_t ch )
+{
+ if ( ch == 27 ) // ESC
+ return NCursesEvent::cancel;
+
+ return NCDialog::wHandleInput( ch );
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupSelection::postAgain
+// METHOD TYPE : bool
+//
+// DESCRIPTION :
+//
+bool NCPkgPopupSelection::postAgain( )
+{
+ if( !postevent.widget )
+ return false;
+
+ postevent.detail = NCursesEvent::NODETAIL;
+
+ if ( postevent.widget == okButton )
+ {
+ postevent.detail = NCursesEvent::USERDEF ;
+ // return false means: close the popup
+ return false;
+ }
+
+ if (postevent == NCursesEvent::cancel)
+ return false;
+
+ return true;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// OrderFunc
+//
+bool order( ZyppSel slb1, ZyppSel slb2 )
+{
+ ZyppSelection ptr1 = tryCastToZyppSelection (slb1->theObj());
+ ZyppSelection ptr2 = tryCastToZyppSelection (slb2->theObj());
+ if ( !ptr1 || !ptr2 )
+ return false;
+ else
+ return ptr1->order() < ptr2->order();
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// OrderFuncPattern
+//
+bool orderPattern( ZyppSel slb1, ZyppSel slb2 )
+{
+ ZyppPattern ptr1 = tryCastToZyppPattern (slb1->theObj());
+ ZyppPattern ptr2 = tryCastToZyppPattern (slb2->theObj());
+ if ( !ptr1 || !ptr2 )
+ return false;
+ else
+ return ptr1->order() < ptr2->order();
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// OrderFuncLang
+//
+bool orderLang( ZyppSel slb1, ZyppSel slb2 )
+{
+ ZyppLang ptr1 = tryCastToZyppLang (slb1->theObj());
+ ZyppLang ptr2 = tryCastToZyppLang (slb2->theObj());
+ if ( !ptr1 || !ptr2 )
+ return false;
+ else
+ return ptr1->name() < ptr2->name();
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupSelection::fillSelectionList
+// METHOD TYPE : bool
+//
+// DESCRIPTION :
+//
+bool NCPkgPopupSelection::fillSelectionList( NCPkgTable * sel, SelType type )
+{
+ if ( !sel )
+ return false;
+
+ ZyppPoolIterator i, b, e;
+ list<ZyppSel> slbList;
+
+ switch ( type )
+ {
+ case S_Selection:
+ {
+ for ( i = zyppSelectionsBegin () ; i != zyppSelectionsEnd (); ++i )
+ {
+ ZyppObj resPtr = (*i)->theObj();
+ bool show;
+
+ ZyppSelection selPtr = tryCastToZyppSelection (resPtr);
+ show = selPtr && selPtr->visible() && !selPtr->isBase();
+ if (show)
+ {
+ NCMIL << resPtr->kind () <<": " << resPtr->name()
+ << ", initial status: " << (*i)->status() << endl;
+
+ slbList.push_back (*i);
+ }
+ }
+ slbList.sort( order );
+
+ break;
+ }
+ case S_Pattern:
+ {
+ for ( i = zyppPatternsBegin () ; i != zyppPatternsEnd (); ++i )
+ {
+ ZyppObj resPtr = (*i)->theObj();
+ bool show;
+
+ ZyppPattern patPtr = tryCastToZyppPattern (resPtr);
+ show = patPtr && patPtr->userVisible ();
+
+ if (show)
+ {
+ NCMIL << resPtr->kind () <<": " << resPtr->name()
+ << ", initial status: " << (*i)->status() << endl;
+
+ slbList.push_back (*i);
+ }
+ }
+ slbList.sort( orderPattern );
+ break;
+ }
+ case S_Language:
+ {
+ for (i = zyppLangBegin (); i != zyppLangEnd (); ++i )
+ {
+ ZyppObj resPtr = (*i)->theObj();
+
+ ZyppLang langPtr = tryCastToZyppLang (resPtr);
+
+ NCMIL << resPtr->kind () <<": " << resPtr->name()
+ << ", initial status: " << (*i)->status() << endl;
+ slbList.push_back (*i);
+
+ }
+ slbList.sort( orderLang );
+ break;
+ }
+
+ default:
+ NCERR << "Selecion type not handled: " << type << endl;
+ }
+
+ list<ZyppSel>::iterator listIt;
+ vector<string> pkgLine;
+ for ( listIt = slbList.begin(); listIt != slbList.end(); ++listIt )
+ {
+ ZyppObj resPtr = (*listIt)->theObj();
+ pkgLine.clear();
+
+ switch (type) {
+ case S_Pattern:
+ case S_Selection: {
+ pkgLine.push_back( resPtr->summary(LOCALE) ); // the description
+ break;
+ }
+ case S_Language: {
+ pkgLine.push_back( resPtr->name() );
+ pkgLine.push_back( resPtr->summary(LOCALE) );
+ break;
+ }
+ default:
+ break;
+ }
+
+ sel->addLine( (*listIt)->status(), // the status
+ pkgLine,
+ resPtr, // ZyppSelection or ZyppPattern
+ (*listIt) ); // ZyppSel
+ }
+
+ return true;
+}
Added: branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupSelection.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupSelection.h?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupSelection.h (added)
+++ branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupSelection.h Fri Feb 8 13:59:32 2008
@@ -0,0 +1,94 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: NCPkgPopupSelection.h
+
+ Author: Gabriele Strattner
+ Maintainer: Michael Andres
+
+/-*/
+#ifndef NCPkgPopupSelection_h
+#define NCPkgPopupSelection_h
+
+#include <iosfwd>
+
+#include <string>
+
+#include "NCPopup.h"
+#include "NCPushButton.h"
+#include "NCPackageSelector.h"
+
+
+///////////////////////////////////////////////////////////////////
+//
+// CLASS NAME : NCPkgPopupSelection
+//
+// DESCRIPTION :
+//
+class NCPkgPopupSelection : public NCPopup {
+
+ NCPkgPopupSelection & operator=( const NCPkgPopupSelection & );
+ NCPkgPopupSelection ( const NCPkgPopupSelection & );
+
+private:
+
+ NCPkgTable *sel; // selection list
+ NCPushButton * okButton;
+
+ NCPackageSelector * packager; // connection to the PackageSelector,
+
+protected:
+
+ std::string getCurrentLine();
+
+ virtual bool postAgain();
+
+ virtual NCursesEvent wHandleInput( wint_t ch );
+
+public:
+
+ enum SelType {
+ S_Selection,
+ S_Pattern,
+ S_Language,
+ S_Unknown
+ };
+
+ NCPkgPopupSelection( const wpos at, NCPackageSelector * pkg, SelType type );
+ virtual ~NCPkgPopupSelection();
+
+ virtual int preferredWidth();
+ virtual int preferredHeight();
+
+ void createLayout( const string & label );
+
+ /**
+ * Fills the list with the available selections (and the status info)
+ * @return bool
+ */
+ bool fillSelectionList ( NCPkgTable * table, SelType type );
+
+ /**
+ * Shows the popup with the add ons (package categories).
+ * @return NCursesEvent
+ */
+ NCursesEvent & showSelectionPopup( );
+
+private:
+
+ SelType type;
+};
+
+///////////////////////////////////////////////////////////////////
+
+
+#endif // NCPkgPopupSelection_h
Added: branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupTable.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupTable.cc?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupTable.cc (added)
+++ branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupTable.cc Fri Feb 8 13:59:32 2008
@@ -0,0 +1,315 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: NCPkgPopupTable.cc
+
+ Author: Gabriele Strattner
+ Maintainer: Michael Andres
+
+/-*/
+#include "Y2Log.h"
+
+#include "YMenuButton.h"
+#include "YDialog.h"
+
+#include "NCLayoutBox.h"
+#include "NCSpacing.h"
+#include "NCPkgNames.h"
+#include "NCPackageSelector.h"
+#include "NCLabel.h"
+#include "NCPushButton.h"
+#include "NCPkgTable.h"
+
+#include "NCZypp.h"
+#include "NCi18n.h"
+
+#include
+#include
+
+#include "NCPkgPopupTable.h"
+
+/*
+ Textdomain "packages"
+*/
+
+using namespace std;
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupTable::NCPkgPopupTable
+// METHOD TYPE : Constructor
+//
+// DESCRIPTION :
+//
+NCPkgPopupTable::NCPkgPopupTable( const wpos at, NCPackageSelector * pkger )
+ : NCPopup( at, false )
+ , pkgTable( 0 )
+ , okButton( 0 )
+ , cancelButton( 0 )
+ , packager( pkger )
+{
+ createLayout( );
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupTable::~NCPkgPopupTable
+// METHOD TYPE : Destructor
+//
+// DESCRIPTION :
+//
+NCPkgPopupTable::~NCPkgPopupTable()
+{
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupTable::createLayout
+// METHOD TYPE : void
+//
+// DESCRIPTION :
+//
+void NCPkgPopupTable::createLayout( )
+{
+ YWidgetOpt opt;
+
+ // the vertical split is the (only) child of the dialog
+ NCLayoutBox * split = new NCLayoutBox( this, YD_VERT );
+
+ // addChild() is obsolete (handled by new libyui)
+
+ //split->addChild( new NCSpacing( split, opt, 0.6, false, true ) );
+ new NCSpacing( split, YD_VERT, false, 0.6 ); // stretchable = false
+
+ // the headline of the popup containing a list with packages with status changes
+ new NCLabel( split, _( "Automatic Changes" ), true, false ); // isHeading = true
+
+ //split->addChild( new NCSpacing( split, opt, 0.6, false, true ) );
+ new NCSpacing( split, YD_VERT, false, 0.6 );
+
+ //NCLabel * lb1 = new NCLabel( split, opt, YCPString(NCPkgNames::AutoChangeText1()) );
+ // text part1 of popup with automatic changes (it's a label; text continous)
+ new NCLabel( split, _( "In addition to your manual selections, the following" ), false, false );
+
+ //NCLabel * lb2 = new NCLabel( split, opt, YCPString(NCPkgNames::AutoChangeText2()) );
+ // text part2 of popup with automatic changes
+ new NCLabel( split, _( "packages have been changed to resolve dependencies:" ), false, false );
+
+ YTableHeader * tableHeader = new YTableHeader();
+ // add the package table (use default type T_Packages)
+ pkgTable = new NCPkgTable( split, tableHeader );
+ pkgTable->setPackager( packager );
+ pkgTable->fillHeader();
+
+ // HBox for the buttons
+ NCLayoutBox * hSplit = new NCLayoutBox( split, YD_HORIZ );
+
+ opt.isHStretchable.setValue( true );
+
+ //hSplit->addChild( new NCSpacing( hSplit, opt, 0.2, true, false ) );
+ new NCSpacing( hSplit, YD_HORIZ, true, 0.2 ); // stretchable = true
+
+ // add the OK button
+ opt.key_Fxx.setValue( 10 );
+ okButton = new NCPushButton( hSplit, NCPkgNames::OKLabel() );
+
+ //hSplit->addChild( new NCSpacing( hSplit, opt, 0.4, true, false ) );
+ new NCSpacing( hSplit, YD_HORIZ, true, 0.4 );
+
+ // add the Cancel button
+ opt.key_Fxx.setValue( 9 );
+ cancelButton = new NCPushButton( hSplit, NCPkgNames::CancelLabel() );
+
+ //hSplit->addChild( new NCSpacing( hSplit, opt, 0.2, true, false ) );
+ new NCSpacing( hSplit, YD_HORIZ, true, 0.2 );
+
+ //split->addChild( new NCSpacing( split, opt, 0.6, false, true ) );
+ new NCSpacing( split, YD_VERT, false, 0.6 );
+}
+
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupTable::fillAutoChanges
+// METHOD TYPE : bool
+//
+// DESCRIPTION :
+//
+bool NCPkgPopupTable::fillAutoChanges( NCPkgTable * pkgTable )
+{
+ if ( !pkgTable )
+ return false;
+
+ pkgTable->itemsCleared(); // clear the table
+
+ set<string> ignoredNames;
+ set<string> userWantedNames = zypp::ui::userWantedPackageNames();
+ //these are the packages already selected for autoinstallation in previous 'verify system' run
+ set<string> verifiedNames = packager->getVerifiedPkgs();
+
+ //initialize storage for the new set
+ insert_iterator< set<string> > result (ignoredNames, ignoredNames.begin());
+
+ if(!verifiedNames.empty())
+ {
+ //if we have some leftovers from previous run, do the union of the sets
+ set_union(userWantedNames.begin(), userWantedNames.end(),
+ verifiedNames.begin(), verifiedNames.end(), result );
+ }
+ else
+ //else just take userWanted stuff
+ ignoredNames = userWantedNames;
+
+ for ( set<string>::iterator it = ignoredNames.begin(); it != ignoredNames.end(); ++it )
+ NCMIL << "Ignoring: " << *it << endl;
+
+ ZyppPoolIterator
+ b = zyppPkgBegin(),
+ e = zyppPkgEnd(),
+ it;
+
+ for (it = b; it != e; ++it)
+ {
+ ZyppSel slb = *it;
+
+ // show all packages which are automatically selected for installation
+ if ( slb->toModify() && slb->modifiedBy () != zypp::ResStatus::USER )
+ {
+ if ( ! inContainer( ignoredNames, slb->name() ) )
+ {
+ ZyppPkg pkgPtr = tryCastToZyppPkg (slb->theObj());
+ if ( pkgPtr )
+ {
+ NCMIL << "The status of " << pkgPtr->name() << " has automatically changed" << endl;
+ pkgTable->createListEntry( pkgPtr, slb );
+ //also add to 'already verified' set
+ packager->insertVerifiedPkg( pkgPtr->name() );
+ }
+ }
+ }
+ }
+
+ pkgTable->drawList();
+
+ if ( pkgTable->getNumLines() > 0 )
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupTable::showInfoPopup
+// METHOD TYPE : NCursesEvent event
+//
+// DESCRIPTION :
+//
+NCursesEvent NCPkgPopupTable::showInfoPopup( )
+{
+ postevent = NCursesEvent();
+
+ if ( !fillAutoChanges( pkgTable ) )
+ {
+ postevent = NCursesEvent::button;
+ return postevent;
+ }
+
+ do {
+ // show the popup
+ popupDialog( );
+ } while ( postAgain() );
+
+ popdownDialog();
+
+ return postevent;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupTable::preferredWidth
+// METHOD TYPE : int
+//
+int NCPkgPopupTable::preferredWidth()
+{
+ return NCurses::cols()-15;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupTable::preferredHeight
+// METHOD TYPE : int
+//
+int NCPkgPopupTable::preferredHeight()
+{
+ return NCurses::lines()-5;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPopup::wHandleInput
+// METHOD TYPE : NCursesEvent
+//
+// DESCRIPTION :
+//
+NCursesEvent NCPkgPopupTable::wHandleInput( wint_t ch )
+{
+ if ( ch == 27 ) // ESC
+ return NCursesEvent::cancel;
+
+ if ( ch == KEY_RETURN )
+ return NCursesEvent::button;
+
+ return NCDialog::wHandleInput( ch );
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupTable::postAgain
+// METHOD TYPE : bool
+//
+// DESCRIPTION :
+//
+bool NCPkgPopupTable::postAgain()
+{
+ if ( ! postevent.widget )
+ return false;
+
+ if ( postevent.widget == cancelButton )
+ {
+ //user hit cancel - discard set of changes (if not empty)
+ packager->clearVerifiedPkgs();
+
+ // close the dialog
+ postevent = NCursesEvent::cancel;
+ }
+
+ if ( postevent == NCursesEvent::button || postevent == NCursesEvent::cancel )
+ {
+ // return false means: close the popup dialog
+ return false;
+ }
+ return true;
+}
+
Added: branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupTable.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupTable.h?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupTable.h (added)
+++ branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupTable.h Fri Feb 8 13:59:32 2008
@@ -0,0 +1,79 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: NCPkgPopupTable.h
+
+ Author: Gabriele Strattner
+ Maintainer: Michael Andres
+
+/-*/
+#ifndef NCPkgPopupTablek_h
+#define NCPkgPopupTable_h
+
+#include <iosfwd>
+
+#include <vector>
+#include <string>
+#include <algorithm>
+
+#include "NCPopup.h"
+
+class NCPkgTable;
+class NCPushButton;
+class NCPackageSelector;
+
+
+///////////////////////////////////////////////////////////////////
+//
+// CLASS NAME : NCPkgPopupTable
+//
+// DESCRIPTION :
+//
+class NCPkgPopupTable : public NCPopup {
+
+ NCPkgPopupTable & operator=( const NCPkgPopupTable & );
+ NCPkgPopupTable ( const NCPkgPopupTable & );
+
+private:
+
+ NCPkgTable * pkgTable;
+ NCPushButton * okButton;
+ NCPushButton * cancelButton;
+ NCPackageSelector * packager;
+
+protected:
+
+ virtual bool postAgain();
+
+ virtual NCursesEvent wHandleInput( wint_t ch );
+
+public:
+
+ NCPkgPopupTable( const wpos at, NCPackageSelector * pkger );
+
+ virtual ~NCPkgPopupTable();
+
+ virtual int preferredWidth();
+ virtual int preferredHeight();
+
+ bool fillAutoChanges( NCPkgTable * pkgTable );
+
+ void createLayout( );
+
+ NCursesEvent showInfoPopup( );
+
+};
+
+///////////////////////////////////////////////////////////////////
+
+
+#endif // NCPkgPopupTable_h
Added: branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupTree.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupTree.cc?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupTree.cc (added)
+++ branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupTree.cc Fri Feb 8 13:59:32 2008
@@ -0,0 +1,325 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: NCPkgPopupTree.cc
+
+ Author: Gabriele Strattner
+ Maintainer: Michael Andres
+
+/-*/
+#include "Y2Log.h"
+#include "NCPkgPopupTree.h"
+
+#include "NCTree.h"
+#include "YMenuButton.h"
+#include "YDialog.h"
+#include "YTreeItem.h"
+#include "NCLayoutBox.h"
+#include "NCPkgNames.h"
+#include "NCPackageSelector.h"
+
+#include "NCZypp.h"
+
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// CLASS NAME : NCRpmGroupItem
+//
+// DESCRIPTION : class derived from YTreeItem with additional
+// property to store the original rpm group item
+//
+//
+class NCRpmGroupItem : public YTreeItem {
+
+private:
+ YStringTreeItem * rpmGroupItem;
+
+public:
+
+ NCRpmGroupItem( YTreeItem * parent,
+ const string & label,
+ YStringTreeItem * origItem )
+ : YTreeItem( parent, label ),
+ rpmGroupItem( origItem )
+ {
+
+ }
+
+ NCRpmGroupItem( const string & label,
+ YStringTreeItem * origItem )
+ : YTreeItem( label ),
+ rpmGroupItem( origItem )
+ {
+
+ }
+
+ YStringTreeItem * getOrigItem() const { return rpmGroupItem; }
+
+};
+
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupTree::NCPkgPopupTree
+// METHOD TYPE : Constructor
+//
+// DESCRIPTION :
+//
+NCPkgPopupTree::NCPkgPopupTree( const wpos at, NCPackageSelector * pkg )
+ : NCPopup( at, false )
+ , filterTree( 0 )
+ , packager ( pkg )
+{
+ // create the layout (the NCTree)
+ createLayout( NCPkgNames::RpmTreeLabel() );
+
+ if ( pkg->rpmGroupsTree() )
+ {
+ // clone the tree (fill the NCTree)
+ cloneTree( pkg->rpmGroupsTree()->root(), 0 );
+ }
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupTree::~NCPkgPopupTree
+// METHOD TYPE : Destructor
+//
+// DESCRIPTION :
+//
+NCPkgPopupTree::~NCPkgPopupTree()
+{
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupTree::createList
+// METHOD TYPE : void
+//
+// DESCRIPTION :
+//
+void NCPkgPopupTree::createLayout( const string & label )
+{
+ // the vertical split is the (only) child of the dialog
+ NCLayoutBox * split = new NCLayoutBox( this, YD_VERT );
+
+ // addChild() is obsolete
+
+ // create the tree
+ filterTree = new NCTree( split, label );
+ YUI_CHECK_NEW( filterTree );
+
+ filterTree->setNotify( true );
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupTree::showFilterPopup
+// METHOD TYPE : void
+//
+// DESCRIPTION :
+//
+NCursesEvent NCPkgPopupTree::showFilterPopup( )
+{
+ postevent = NCursesEvent();
+
+ // event loop
+ do {
+ popupDialog();
+ } while ( postAgain() );
+
+ popdownDialog();
+
+ if ( !packager || !filterTree )
+ return postevent;
+
+ YStringTreeItem * origItem;
+
+ // get the currently selected rpm group and show the package list
+ if ( postevent.detail == NCursesEvent::USERDEF )
+ {
+ const YTreeItem * item = filterTree->getCurrentItem();
+
+ if ( item )
+ {
+ const NCRpmGroupItem * rpmGroupItem = dynamic_cast(item);
+
+ if ( rpmGroupItem )
+ {
+ // get the original rpm group item (YStringTreeItem)
+ origItem = rpmGroupItem->getOrigItem();
+
+ if ( origItem )
+ {
+ string label = origItem->value().translation();
+
+ // fill the package list
+ packager->fillPackageList( YCPString( label ), origItem );
+
+ NCMIL << "Selected RPM group: " << label << endl;
+ }
+ }
+ }
+ else
+ {
+ NCERR << "Current item not valid" << endl;
+ }
+ }
+
+ return postevent;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupTree::preferredWidth
+// METHOD TYPE : int
+//
+int NCPkgPopupTree::preferredWidth()
+{
+ return NCurses::cols()/2;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupTree::preferredHeight
+// METHOD TYPE : int
+//
+int NCPkgPopupTree::preferredHeight()
+{
+ int vdim;
+ if ( NCurses::lines() > 20 )
+ vdim = 20;
+ else
+ vdim = NCurses::lines()-4;
+
+ return vdim;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupTree::addItem
+// METHOD TYPE : void
+//
+// DESCRIPTION :
+//
+void NCPkgPopupTree::addItem( YTreeItem * newItem )
+{
+ if ( !filterTree )
+ {
+ NCERR << "ERROR: rpm groups tree not available" << endl;
+ return;
+ }
+
+ filterTree->addItem( newItem );
+
+}
+
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupTree::wHandleHotkey
+// METHOD TYPE : NCursesEvent
+//
+// DESCRIPTION :
+//
+NCursesEvent NCPkgPopupTree::wHandleHotkey( wint_t key )
+{
+
+ return NCursesEvent::none;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPopup::wHandleInput
+// METHOD TYPE : NCursesEvent
+//
+// DESCRIPTION :
+//
+NCursesEvent NCPkgPopupTree::wHandleInput( wint_t ch )
+{
+ if ( ch == 27 ) // ESC
+ return NCursesEvent::cancel;
+
+ return NCDialog::wHandleInput( ch );
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupTree::postAgain
+// METHOD TYPE : bool
+//
+// DESCRIPTION :
+//
+bool NCPkgPopupTree::postAgain()
+{
+ postevent.detail = NCursesEvent::NODETAIL;
+
+ if ( postevent == NCursesEvent::button
+ && postevent.reason == YEvent::Activated )
+ {
+ postevent.detail = NCursesEvent::USERDEF ;
+
+ // return false means: close the popup
+ return false;
+ }
+
+ if ( postevent == NCursesEvent::cancel )
+ return false;
+
+ return true;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// cloneTree
+//
+// Adds all tree items got from YPkgRpmGroupTagsFilterView to
+// the filter popup tree
+//
+void NCPkgPopupTree::cloneTree( YStringTreeItem * parentOrig, NCRpmGroupItem * parentClone )
+{
+ YStringTreeItem * child = parentOrig->firstChild();
+ NCRpmGroupItem * clone;
+
+ while ( child )
+ {
+ NCDBG << "Rpm group (translated): " << child->value().translation() << endl;
+
+ if ( parentClone )
+ {
+ // YTreeItems which have a parent will automatically register
+ // this item with the parent item.
+ clone = new NCRpmGroupItem( parentClone, child->value().translation(), child );
+ }
+ else
+ {
+ clone = new NCRpmGroupItem( child->value().translation(), child );
+ // use addItem() only for the toplevel items
+ addItem( clone );
+ }
+
+ cloneTree( child, clone );
+ child = child->next();
+ }
+}
+
Added: branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupTree.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupTree.h?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupTree.h (added)
+++ branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupTree.h Fri Feb 8 13:59:32 2008
@@ -0,0 +1,87 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: NCPkgPopupTree.h
+
+ Author: Gabriele Strattner
+ Maintainer: Michael Andres
+
+/-*/
+#ifndef NCPkgPopupTree_h
+#define NCPkgPopupTree_h
+
+#include <iosfwd>
+
+#include <vector>
+#include <string>
+
+#include "NCPopup.h"
+#include "NCTree.h"
+#include "NCLabel.h"
+#include "NCRichText.h"
+
+#include
+
+class NCTree;
+class NCPackageSelector;
+class NCRpmGroupItem;
+
+///////////////////////////////////////////////////////////////////
+//
+// CLASS NAME : NCPkgPopupTree
+//
+// DESCRIPTION :
+//
+class NCPkgPopupTree : public NCPopup {
+
+ NCPkgPopupTree & operator=( const NCPkgPopupTree & );
+ NCPkgPopupTree ( const NCPkgPopupTree & );
+
+private:
+
+ NCTree * filterTree; // the YTree
+
+ NCPackageSelector * packager; // connection to the PackageSelector
+
+ // internal use (copies tree items)
+ void cloneTree( YStringTreeItem * parentOrig, NCRpmGroupItem * parentClone );
+
+protected:
+
+ void setCurrentItem( int index );
+
+ virtual NCursesEvent wHandleHotkey( wint_t ch );
+
+ virtual bool postAgain();
+
+ virtual NCursesEvent wHandleInput( wint_t ch );
+
+public:
+
+ NCPkgPopupTree( const wpos at, NCPackageSelector * packager );
+ virtual ~NCPkgPopupTree();
+
+ virtual int preferredWidth();
+ virtual int preferredHeight();
+
+ void createLayout( const string & label );
+
+ void addItem( YTreeItem * newItem );
+
+ NCursesEvent showFilterPopup( );
+
+};
+
+///////////////////////////////////////////////////////////////////
+
+
+#endif // NCPkgPopupTree_h
Added: branches/tmp/bubli/ncurses-pkg/src/NCPkgSelMapper.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/NCPkgSelMapper.cc?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/src/NCPkgSelMapper.cc (added)
+++ branches/tmp/bubli/ncurses-pkg/src/NCPkgSelMapper.cc Fri Feb 8 13:59:32 2008
@@ -0,0 +1,102 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: NCPkgSelMapper.cc
+
+ Author: Stefan Hundhammer
+
+/-*/
+
+
+#define y2log_component "ncurses-pkg"
+#include
+
+#include "NCPkgSelMapper.h"
+
+
+
+int NCPkgSelMapper::_refCount = 0;
+NCPkgSelMapper::Cache NCPkgSelMapper::_cache;
+
+
+NCPkgSelMapper::NCPkgSelMapper()
+{
+ if ( ++_refCount == 1 )
+ rebuildCache();
+}
+
+
+NCPkgSelMapper::~NCPkgSelMapper()
+{
+ if ( --_refCount == 0 )
+ {
+ y2debug( "Destroying pkg -> selectable cache" );
+ _cache.clear();
+ }
+}
+
+
+void NCPkgSelMapper::rebuildCache()
+{
+ _cache.clear();
+ y2debug( "Building pkg -> selectable cache" );
+
+ for ( ZyppPoolIterator sel_it = zyppPkgBegin();
+ sel_it != zyppPkgEnd();
+ ++sel_it )
+ {
+ ZyppSel sel = *sel_it;
+
+ if ( sel->installedObj() )
+ {
+ // The installed package (if there is any) may or may not be in the list
+ // of available packages. Better make sure to insert it.
+
+ ZyppPkg installedPkg = tryCastToZyppPkg( sel->installedObj() );
+
+ if ( installedPkg )
+ _cache.insert( CachePair( installedPkg, sel ) );
+ }
+
+ zypp::ui::Selectable::available_iterator it = sel->availableBegin();
+
+ while ( it != sel->availableEnd() )
+ {
+ ZyppPkg pkg = tryCastToZyppPkg( *it );
+
+ if ( pkg )
+ _cache.insert( CachePair( pkg, sel ) );
+
+ ++it;
+ }
+ }
+
+ y2debug( "Building pkg -> selectable cache done" );
+}
+
+
+ZyppSel
+NCPkgSelMapper::findZyppSel( ZyppPkg pkg )
+{
+ NCPkgSelMapper mapper; // This will build a cache, if there is none yet
+ ZyppSel sel;
+
+ NCPkgSelMapper::CacheIterator it = NCPkgSelMapper::_cache.find( pkg );
+
+ if ( it != NCPkgSelMapper::_cache.end() )
+ sel = it->second;
+ else
+ y2warning( "No selectable found for package %s", pkg->name().c_str() );
+
+ return sel;
+}
+
Added: branches/tmp/bubli/ncurses-pkg/src/NCPkgSelMapper.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/NCPkgSelMapper.h?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/src/NCPkgSelMapper.h (added)
+++ branches/tmp/bubli/ncurses-pkg/src/NCPkgSelMapper.h Fri Feb 8 13:59:32 2008
@@ -0,0 +1,85 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: NCPkgSelMapper.h
+
+ Author: Stefan Hundhammer
+
+/-*/
+
+// -*- c++ -*-
+
+#ifndef NCPkgSelMapper_h
+#define NCPkgSelMapper_h
+
+#include "NCZypp.h"
+#include <map>
+
+
+
+/**
+ * Mapping from ZyppPkg to the correspoinding ZyppSel.
+ *
+ * All instances of this class share the same cache. The cache remains alive as
+ * long as any instance of this class exists.
+ **/
+class NCPkgSelMapper
+{
+public:
+
+ /**
+ * Constructor. Builds a cache, if necessary.
+ **/
+ NCPkgSelMapper();
+
+ /**
+ * Destructor. Clears the cache if this was the last NCPkgSelMapper
+ * (i.e. if refCount() reaches 0)
+ **/
+ virtual ~NCPkgSelMapper();
+
+ /**
+ * Find the corresponding ZyppSel to a ZyppPkg.
+ * Returns 0 if there is no corresponding ZyppSel.
+ **/
+
+ ZyppSel findZyppSel( ZyppPkg pkg );
+
+ /**
+ * Reference count - indicates how many instances of this class are alive
+ * right now.
+ **/
+ static int refCount() { return _refCount; }
+
+ /**
+ * Rebuild the shared cache. This is expensive. Call this only when the
+ * ZyppPool has changed, i.e. after installation sources were added or
+ * removed.
+ *
+ * Since the cache is shared, this affects all instances of this class.
+ **/
+ void rebuildCache();
+
+
+protected:
+
+ typedef std::map Cache;
+ typedef std::pair CachePair;
+ typedef Cache::iterator CacheIterator;
+
+ static int _refCount;
+ static Cache _cache;
+};
+
+
+
+#endif // NCPkgSelMapper_h
Added: branches/tmp/bubli/ncurses-pkg/src/NCPkgStatusStrategy.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/NCPkgStatusStrategy.cc?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/src/NCPkgStatusStrategy.cc (added)
+++ branches/tmp/bubli/ncurses-pkg/src/NCPkgStatusStrategy.cc Fri Feb 8 13:59:32 2008
@@ -0,0 +1,659 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: NCPkgStatusStrategy.cc
+
+ Author: Gabriele Strattner
+ Maintainer: Michael Andres
+
+/-*/
+#include "Y2Log.h"
+#include "NCPkgStatusStrategy.h"
+
+#include "NCTable.h"
+
+#include "NCZypp.h"
+
+#include
+#include
+
+
+//------------------------------------------------------------
+// Base class for strategies to handle status
+//------------------------------------------------------------
+
+//
+// Constructor
+//
+NCPkgStatusStrategy::NCPkgStatusStrategy()
+{
+}
+
+//
+// Destructor - must be defined here (because it is pure virtual)
+//
+NCPkgStatusStrategy::~NCPkgStatusStrategy()
+{
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// NCPkgStatusStrategy::getPackageStatus()
+//
+// Gets status from package manager
+//
+ZyppStatus NCPkgStatusStrategy::getPackageStatus( ZyppSel slbPtr,
+ ZyppObj objPtr )
+{
+ if ( slbPtr )
+ {
+ return slbPtr->status();
+ }
+ else
+ {
+ NCERR << "Selectable pointer not valid" << endl;
+ return S_NoInst;
+ }
+}
+
+/////////////////////////////////////////////////////////////////
+//
+// NCPkgStatusStrategy::setObjectStatus()
+//
+// Informs the package manager about the status change
+//
+bool NCPkgStatusStrategy::setObjectStatus( ZyppStatus newstatus, ZyppSel slbPtr, ZyppObj objPtr )
+{
+ bool ok = false;
+
+ if ( !slbPtr )
+ {
+ NCERR << "Invalid package object" << endl;
+ return false;
+ }
+
+ ok = slbPtr->set_status( newstatus );
+
+ NCMIL << "Set status of: " << slbPtr->name() << " to: "
+ << newstatus << " returns: " << (ok?"true":"false") << endl;
+
+ return ok;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// NCPkgStatusStrategy::keyToStatus()
+//
+// Returns the corresponding status
+//
+bool NCPkgStatusStrategy::keyToStatus( const int & key,
+ ZyppSel slbPtr,
+ ZyppObj objPtr,
+ ZyppStatus & newStat )
+{
+ if ( !slbPtr )
+ return false;
+
+ bool valid = true;
+ ZyppStatus retStat = S_NoInst;
+ ZyppStatus oldStatus = getPackageStatus( slbPtr, objPtr );
+ bool installed = slbPtr->hasInstalledObj();
+
+ // get the new status
+ switch ( key )
+ {
+ case '-':
+ if ( installed ) // installed package -> always set status to delete
+ {
+ // if required, NCPkgTable::changeStatus() shows the delete notify
+ retStat = S_Del;
+ }
+ else
+ {
+ retStat = S_NoInst;
+ }
+ break;
+ case '+':
+ if ( oldStatus == S_NoInst
+ || oldStatus == S_AutoInstall )
+ {
+ // if required, NCPkgTable::changeStatus() shows the notify message
+ retStat = S_Install;
+ }
+ else if ( oldStatus == S_Del
+ || oldStatus == S_AutoDel)
+ {
+ retStat = S_KeepInstalled;
+ }
+ else if ( oldStatus == S_AutoUpdate )
+ {
+ retStat = S_Update;
+ }
+ else
+ {
+ valid = false;
+ }
+ break;
+ case '>':
+ if ( oldStatus == S_KeepInstalled
+ || oldStatus == S_Del
+ || oldStatus == S_AutoDel )
+ {
+ if ( slbPtr->hasCandidateObj() )
+ {
+ retStat = S_Update;
+ }
+ }
+ else
+ {
+ valid = false;
+ }
+ break;
+ //this is the case for 'going back' i.e. S_Install -> S_NoInst, S_Update -> S_KeepInstalled
+ //not for S_Del, since '+' key does this
+ case '<':
+ if ( oldStatus == S_Install
+ || oldStatus == S_AutoInstall )
+ {
+ retStat = S_NoInst;
+ }
+ else if ( oldStatus == S_Update
+ || oldStatus == S_AutoUpdate )
+ {
+ retStat = S_KeepInstalled;
+ }
+ break;
+ case '!': // set S_Taboo or S_Protected
+ if ( !installed )
+ {
+ retStat = S_Taboo;
+ }
+ else
+ {
+ retStat = S_Protected;
+ }
+ break;
+ case '%': // reset S_Taboo or S_Protected status
+ if ( oldStatus == S_Taboo )
+ {
+ retStat = S_NoInst;
+ }
+ else if ( oldStatus == S_Protected )
+ {
+ retStat = S_KeepInstalled;
+ }
+ else
+ {
+ valid = false;
+ }
+ break;
+ default:
+ NCDBG << "Key not valid" << endl;
+ valid = false;
+ }
+
+ if ( valid )
+ newStat = retStat;
+
+ return valid;
+}
+
+
+///////////////////////////////////////////////////////////////////
+//
+// NCPkgStatusStrategy::toggleStatus()
+//
+// Returns the new status
+//
+bool NCPkgStatusStrategy::toggleStatus( ZyppSel slbPtr,
+ ZyppObj objPtr,
+ ZyppStatus & newStat )
+{
+ if ( !slbPtr )
+ return false;
+
+ bool ok = true;
+
+ ZyppStatus oldStatus = getPackageStatus( slbPtr, objPtr );
+ ZyppStatus newStatus = oldStatus;
+
+ switch ( oldStatus )
+ {
+ case S_Del:
+ newStatus = S_KeepInstalled;
+ break;
+ case S_Install:
+ newStatus =S_NoInst ;
+ break;
+ case S_Update:
+ newStatus = S_Del;
+ break;
+ case S_KeepInstalled:
+ if ( slbPtr->hasCandidateObj() )
+ {
+ newStatus = S_Update;
+ }
+ else
+ {
+ newStatus = S_Del;
+ }
+ break;
+ case S_NoInst:
+ if ( slbPtr->hasCandidateObj() )
+ {
+ newStatus = S_Install;
+ }
+ else
+ {
+ NCWAR << "No candidate object for " << slbPtr->theObj()->name().c_str() << endl;
+ newStatus = S_NoInst;
+ }
+ break;
+ case S_AutoInstall:
+ //Correct transition is S_Taboo -> #254816
+ newStatus = S_Taboo;
+ break;
+ case S_AutoDel:
+ newStatus = S_KeepInstalled;
+ break;
+ case S_AutoUpdate:
+ newStatus = S_KeepInstalled;
+ break;
+ case S_Taboo:
+ newStatus = S_NoInst;
+ break;
+ case S_Protected:
+ newStatus = S_KeepInstalled;
+ break;
+ }
+
+ newStat = newStatus;
+
+ return ok;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// NCPkgStatusStrategy::solveResolvableCollections()
+//
+// Do a "small" solver run
+//
+void NCPkgStatusStrategy::solveResolvableCollections()
+{
+ zypp::Resolver_Ptr resolver = zypp::getZYpp()->resolver();
+ // transactReskind() is obsolete -> use resolvePool()
+ resolver->resolvePool();
+
+#if 0
+ resolver->transactReset( zypp::ResStatus::APPL_LOW );
+
+ resolver->transactResKind( zypp::ResTraitszypp::Product::kind );
+ resolver->transactResKind( zypp::ResTraitszypp::Selection::kind );
+ resolver->transactResKind( zypp::ResTraits::kind );
+ resolver->transactResKind( zypp::ResTraits::kind );
+ resolver->transactResKind( zypp::ResTraits::kind );
+ resolver->transactResKind( zypp::ResTraits::kind );
+#endif
+}
+
+
+
+//------------------------------------------------------------
+// Class for strategies to get status for packages
+//------------------------------------------------------------
+
+//
+// Constructor
+//
+PackageStatStrategy::PackageStatStrategy()
+ : NCPkgStatusStrategy()
+{
+}
+
+
+
+
+//------------------------------------------------------------
+// Class for strategies to get status for patches
+//------------------------------------------------------------
+
+//
+// Constructor
+//
+PatchStatStrategy::PatchStatStrategy()
+ : NCPkgStatusStrategy()
+{
+}
+
+
+///////////////////////////////////////////////////////////////////
+//
+// PatchStatStrategy::keyToStatus()
+//
+// Returns the corresponding status
+//
+bool PatchStatStrategy::keyToStatus( const int & key,
+ ZyppSel slbPtr,
+ ZyppObj objPtr,
+ ZyppStatus & newStat )
+{
+ if ( !slbPtr )
+ return false;
+
+ bool valid = true;
+ ZyppStatus retStat = S_NoInst;
+ ZyppStatus oldStatus = getPackageStatus( slbPtr, objPtr );
+ bool installed = slbPtr->hasInstalledObj();
+
+ // get the new status
+ switch ( key )
+ {
+ case '-':
+ if ( installed ) // installed ->set status to delete
+ {
+ retStat = S_Del;
+ }
+ else
+ {
+ retStat = S_NoInst;
+ }
+ break;
+ case '+':
+ if ( oldStatus == S_NoInst
+ || oldStatus == S_AutoInstall )
+ {
+ retStat = S_Install;
+ }
+ else if ( oldStatus == S_Del
+ || oldStatus == S_AutoDel)
+ {
+ retStat = S_KeepInstalled;
+ }
+ else
+ {
+ valid = false;
+ }
+
+ break;
+ case '>':
+ if ( oldStatus == S_KeepInstalled
+ || oldStatus == S_Del
+ || oldStatus == S_AutoDel )
+ {
+ if ( slbPtr->hasCandidateObj() )
+ {
+ retStat = S_Update;
+ }
+ }
+ else
+ {
+ valid = false;
+ }
+ break;
+ default:
+ NCDBG << "Key not valid" << endl;
+ valid = false;
+ }
+
+ if ( valid )
+ newStat = retStat;
+
+ return valid;
+}
+
+#if EXTRA_PATCH_STRATEGY
+
+///////////////////////////////////////////////////////////////////
+//
+// PatchStatStrategy::toggleStatus()
+//
+// Returns the new status
+//
+bool PatchStatStrategy::toggleStatus( ZyppSel slbPtr,
+ ZyppObj objPtr,
+ ZyppStatus & newStat )
+{
+ if ( !slbPtr )
+ return false;
+
+ bool ok = true;
+
+ ZyppStatus oldStatus = getPackageStatus( slbPtr, objPtr );
+ ZyppStatus newStatus = oldStatus;
+
+ switch ( oldStatus )
+ {
+ case S_Install:
+ case S_AutoInstall:
+ newStatus =S_NoInst ;
+ break;
+ case S_Update:
+ case S_AutoUpdate:
+ case S_AutoDel:
+ newStatus = S_KeepInstalled;
+ break;
+ case S_KeepInstalled:
+ if ( slbPtr->hasCandidateObj() )
+ {
+ newStatus = S_Update;
+ }
+ break;
+ case S_NoInst:
+ newStatus = S_Install ;
+ break;
+ case S_Taboo:
+ newStatus = S_NoInst;
+ break;
+ case S_Protected:
+ newStatus = S_KeepInstalled;
+ break;
+ default:
+ newStatus = oldStatus;
+ }
+
+ newStat = newStatus;
+
+ return ok;
+}
+#endif
+
+/////////////////////////////////////////////////////////////////
+//
+// PatchStatStrategy::setObjectStatus()
+//
+// Inform the package manager about the status change
+// of the patch
+//
+bool PatchStatStrategy::setObjectStatus( ZyppStatus newstatus, ZyppSel slbPtr, ZyppObj objPtr )
+{
+ bool ok = false;
+
+ if ( !slbPtr )
+ {
+ NCERR << "Invalid patch object" << endl;
+ return false;
+ }
+
+ ok = slbPtr->set_status( newstatus );
+ NCMIL << "Set status of: " << slbPtr->name() << " to: "
+ << newstatus << " returns: " << (ok?"true":"false") << endl;
+
+ // do a solver run
+ solveResolvableCollections();
+
+ return ok;
+}
+
+//------------------------------------------------------------
+// Class for strategies for selections
+//------------------------------------------------------------
+
+//
+// Constructor
+//
+SelectionStatStrategy::SelectionStatStrategy()
+ : NCPkgStatusStrategy()
+{
+}
+
+/////////////////////////////////////////////////////////////////
+//
+// SelectionStatStrategy::setObjectStatus()
+//
+// Inform the package manager about the status change
+// of the selection
+//
+bool SelectionStatStrategy::setObjectStatus( ZyppStatus newstatus, ZyppSel slbPtr, ZyppObj objPtr )
+{
+ bool ok = false;
+
+ if ( !slbPtr || !objPtr )
+ {
+ NCERR << "Invalid selection" << endl;
+ return false;
+ }
+
+ ok = slbPtr->set_status( newstatus );
+ NCMIL << "Set status of: " << slbPtr->name() << " to: "
+ << newstatus << " returns: " << (ok?"true":"false") << endl;
+
+ // do a solver run -> solver runs in NCPkgTable::changeStatus()
+ // solveResolvableCollections();
+
+ return ok;
+}
+
+//------------------------------------------------------------
+// Class for strategies for depndencies
+//------------------------------------------------------------
+
+//
+// Constructor
+//
+DependencyStatStrategy::DependencyStatStrategy()
+ : NCPkgStatusStrategy()
+{
+}
+
+//------------------------------------------------------------
+// Class for strategies to get status for available packages
+//------------------------------------------------------------
+
+//
+// Constructor
+//
+AvailableStatStrategy::AvailableStatStrategy()
+ : NCPkgStatusStrategy()
+{
+}
+
+
+
+///////////////////////////////////////////////////////////////////
+//
+// AvailableStatStrategy::setObjectStatus
+//
+// Informs the package manager about the new status (sets the candidate)
+//
+bool AvailableStatStrategy::setObjectStatus( ZyppStatus newstatus, ZyppSel slbPtr, ZyppObj objPtr )
+{
+ bool ok = false;
+
+ if ( !slbPtr || !objPtr )
+ {
+ return false;
+ }
+
+ ZyppObj newCandidate = objPtr;
+
+ if ( newCandidate != slbPtr->candidateObj() )
+ {
+ NCMIL << "CANDIDATE changed" << endl;
+
+ // Change status of selectable
+ ZyppStatus status = slbPtr->status();
+
+ if ( slbPtr->installedObj() &&
+ slbPtr->installedObj()->edition() == newCandidate->edition() )
+ {
+ // Switch back to the original instance -
+ // the version that was previously installed
+ status = S_KeepInstalled;
+ }
+ else
+ {
+ switch ( status )
+ {
+ case S_KeepInstalled:
+ case S_Protected:
+ case S_AutoDel:
+ case S_AutoUpdate:
+ case S_Del:
+ case S_Update:
+
+ status = S_Update;
+ break;
+
+ case S_NoInst:
+ case S_Taboo:
+ case S_Install:
+ case S_AutoInstall:
+ status = S_Install;
+ break;
+ }
+ }
+
+ // Set status
+ ok = slbPtr->set_status( status );
+ NCMIL << "Set status of: " << slbPtr->name() << " to: "
+ << status << " returns: " << (ok?"true":"false") << endl;
+
+ // Set candidate
+ ok = slbPtr->setCandidate( newCandidate );
+ NCMIL << "Set user candidate returns: " << (ok?"true":"false") << endl;
+
+ }
+
+ return ok;
+}
+
+//------------------------------------------------------------
+// Class for strategies to get status for available packages
+//------------------------------------------------------------
+
+//
+// Constructor
+//
+UpdateStatStrategy::UpdateStatStrategy()
+ : NCPkgStatusStrategy()
+{
+}
+
+
+//------------------------------------------------------------
+// Class for strategies to get status for patch packages
+//------------------------------------------------------------
+
+//
+// Constructor
+//
+PatchPkgStatStrategy::PatchPkgStatStrategy()
+ : NCPkgStatusStrategy()
+{
+}
+
+bool PatchPkgStatStrategy::setObjectStatus( ZyppStatus newstatus,
+ ZyppSel slbPtr, ZyppObj objPtr )
+{
+ // it is not possible to set the status of the packages belonging to a certain patch
+ return false;
+}
Added: branches/tmp/bubli/ncurses-pkg/src/NCPkgStatusStrategy.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/NCPkgStatusStrategy.h?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/src/NCPkgStatusStrategy.h (added)
+++ branches/tmp/bubli/ncurses-pkg/src/NCPkgStatusStrategy.h Fri Feb 8 13:59:32 2008
@@ -0,0 +1,245 @@
+/*-----------------------------------------------------------*- c++ -*-\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: NCPkgStatusStrategy.h
+
+ Author: Gabriele Strattner
+ Maintainer: Michael Andres
+
+
+/-*/
+#ifndef NCPkgStatusStrategy_h
+#define NCPkgStatusStrategy_h
+
+#include "NCZypp.h"
+#include
+
+#define EXTRA_PATCH_STRATEGY 0
+
+//------------------------------------------------------------
+// Abstract base class for strategies to get status for packages or patches
+//------------------------------------------------------------
+class NCPkgStatusStrategy
+{
+
+public:
+
+ NCPkgStatusStrategy( );
+
+ virtual ~NCPkgStatusStrategy() = 0;
+
+ /**
+ * Gets the status information from the package manager.
+ * @param slbPtr The package whose status to calculate.
+ * @return UI_Status The new status of the given package
+ *
+ **/
+ virtual ZyppStatus getPackageStatus ( ZyppSel slbPtr, ZyppObj objPtr );
+
+ /**
+ * Informs the package manager about the new status.
+ * @param newStatus The new package status
+ * @param slbPtr The selectable pointer (e.g. a package pointer)
+ * @param pkgPtr The object pointer (used for candidate selection)
+ * @return bool
+ */
+ virtual bool setObjectStatus ( ZyppStatus newstatus,
+ ZyppSel slbPtr,
+ ZyppObj objPtr
+ );
+ /**
+ * Returns the new status to the given key (respecting the old
+ * status of th eobject).
+ * @param key The userinput (the key which is pressed)
+ * @param slbPtr The object pointer (e.g. a package pointer)
+ * @param newStatus The new package status
+ * @return bool
+ */
+ virtual bool keyToStatus( const int & key,
+ ZyppSel slbPtr,
+ ZyppObj objPtr,
+ ZyppStatus & newStat );
+
+ /**
+ * Toggles the package status (e.g. from installed to delete)
+ * @param The object pointer
+ * @return bool
+ */
+ virtual bool toggleStatus( ZyppSel slbPtr,
+ ZyppObj objPtr,
+ ZyppStatus & newStat );
+ /**
+ * Do a "small" solver run for all "resolvable collections", i.e., for
+ * selections, patterns, languages, patches.
+ **/
+ void solveResolvableCollections();
+
+
+};
+
+//------------------------------------------------------------
+// Class for strategies to handle status of packages
+//------------------------------------------------------------
+class PackageStatStrategy : public NCPkgStatusStrategy
+{
+public:
+
+ PackageStatStrategy( );
+
+ virtual ~PackageStatStrategy() {}
+
+};
+
+//------------------------------------------------------------
+// Class for strategies to handle dependencies
+//------------------------------------------------------------
+class DependencyStatStrategy : public NCPkgStatusStrategy
+{
+public:
+
+ DependencyStatStrategy( );
+
+ virtual ~DependencyStatStrategy() {}
+
+};
+
+//------------------------------------------------------------
+// Class for strategies of update
+//------------------------------------------------------------
+class UpdateStatStrategy : public NCPkgStatusStrategy
+{
+public:
+
+ UpdateStatStrategy( );
+
+ virtual ~UpdateStatStrategy() {}
+
+};
+
+//------------------------------------------------------------
+// Class for strategies of selections
+//------------------------------------------------------------
+class SelectionStatStrategy : public NCPkgStatusStrategy
+{
+public:
+
+ SelectionStatStrategy( );
+
+ virtual ~SelectionStatStrategy() {}
+
+ /**
+ * Sets the status of the selection
+ * @param newStatus The new selection status
+ * @param slbPtr The selectable pointer
+ * @qparam objPtr The object (selection) pointer
+ * @return bool
+ */
+ virtual bool setObjectStatus( ZyppStatus newstatus,
+ ZyppSel slbPtr,
+ ZyppObj objPtr );
+
+};
+
+//------------------------------------------------------------
+// Class for strategies to handle status of packages belonging to a patch
+//------------------------------------------------------------
+class PatchPkgStatStrategy : public NCPkgStatusStrategy
+{
+public:
+
+ PatchPkgStatStrategy( );
+
+ virtual ~PatchPkgStatStrategy() {}
+
+ /**
+ * It is not possible to set the package status for packages belonging to a patch,
+ * i.e. returns always false.
+ */
+ virtual bool setObjectStatus( ZyppStatus newstatus,
+ ZyppSel slbPtr,
+ ZyppObj objPtr );
+
+};
+
+
+
+//------------------------------------------------------------
+// Class for strategies to handle status of patches
+//------------------------------------------------------------
+class PatchStatStrategy : public NCPkgStatusStrategy
+{
+public:
+
+ PatchStatStrategy( );
+
+ virtual ~PatchStatStrategy() {}
+
+ /**
+ * Returns the new status to the given key (respecting the old
+ * status of the patch).
+ * @param key The userinput (the key which is pressed)
+ * @param slbPtr The object pointer (the patch pointer)
+ * @param newStatus The new package status
+ * @return bool
+ */
+ virtual bool keyToStatus( const int & key,
+ ZyppSel slbPtr,
+ ZyppObj objPtr,
+ ZyppStatus & newStat );
+
+#if EXTRA_PATCH_STRATEGY
+ /**
+ * Toggles the patch status (e.g. from selected to unselected)
+ * @param The object pointer
+ * @return bool
+ */
+ virtual bool toggleStatus( ZyppSel slbPtr,
+ ZyppObj objPtr,
+ ZyppStatus & newStat );
+#endif
+
+ /**
+ * Sets the status of the patch AND the status of the patch packages
+ * @param newStatus The new package status
+ * @param slbPtr The object pointer (e.g. a package pointer)
+ * @return bool
+ */
+ virtual bool setObjectStatus( ZyppStatus newstatus, ZyppSel slbPtr, ZyppObj objPtr );
+};
+
+
+
+//------------------------------------------------------------
+// Class for strategies to handle status of available packages
+//------------------------------------------------------------
+class AvailableStatStrategy : public NCPkgStatusStrategy
+{
+public:
+
+ AvailableStatStrategy( );
+
+ virtual ~AvailableStatStrategy() {}
+
+ /**
+ * Informs the package manager about the new status and
+ * additionally sets the candidate object to the user chosen object.
+ * @param newStatus The new package status
+ * @param slbPtr The package pointer
+ * @param pkgPtr The object pointer (used for candidate selection)
+ * @return bool
+ */
+ virtual bool setObjectStatus( ZyppStatus newstatus,
+ ZyppSel slbPtr, ZyppObj objPtr );
+};
+
+#endif
+
Added: branches/tmp/bubli/ncurses-pkg/src/NCPkgTable.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/NCPkgTable.cc?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/src/NCPkgTable.cc (added)
+++ branches/tmp/bubli/ncurses-pkg/src/NCPkgTable.cc Fri Feb 8 13:59:32 2008
@@ -0,0 +1,1042 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: NCPkgTable.cc
+
+ Author: Gabriele Strattner
+ Maintainer: Michael Andres
+
+/-*/
+#include "Y2Log.h"
+#include "NCurses.h"
+#include "NCPkgTable.h"
+#include "NCTable.h"
+#include "NCPopupInfo.h"
+#include "NCPkgNames.h"
+#include "NCi18n.h"
+
+#include "NCPackageSelector.h"
+#include
+#include "NCZypp.h"
+
+/*
+ Textdomain "packages"
+*/
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgTableTag::NCPkgTableTag
+// METHOD TYPE : Constructor
+//
+// DESCRIPTION :
+//
+NCPkgTableTag::NCPkgTableTag( ZyppObj objPtr, ZyppSel selPtr,
+ ZyppStatus stat )
+ : NCTableCol( NCstring( " " ), SEPARATOR )
+ , status ( stat )
+ , dataPointer( objPtr )
+ , selPointer( selPtr )
+{
+
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgTableTag::DrawAt
+// METHOD TYPE : virtual DrawAt
+//
+// DESCRIPTION :
+//
+void NCPkgTableTag::DrawAt( NCursesWindow & w, const wrect at,
+ NCTableStyle & tableStyle,
+ NCTableLine::STATE linestate,
+ unsigned colidx ) const
+{
+ NCTableCol::DrawAt( w, at, tableStyle, linestate, colidx );
+
+ string statusStr = statusToStr( status );
+ w.addch( at.Pos.L, at.Pos.C, statusStr.c_str()[0] );
+ w.addch( at.Pos.L, at.Pos.C +1, statusStr.c_str()[1] );
+ w.addch( at.Pos.L, at.Pos.C +2, statusStr.c_str()[2] );
+ w.addch( at.Pos.L, at.Pos.C +3, statusStr.c_str()[3] );
+}
+
+
+string NCPkgTableTag::statusToStr( ZyppStatus stat ) const
+{
+ // convert ZyppStatus to string
+ switch ( stat )
+ {
+ case S_NoInst: // Is not installed and will not be installed
+ return " ";
+ case S_KeepInstalled: // Is installed - keep this version
+ return " i ";
+ case S_Install: // Will be installed
+ return " + ";
+ case S_Del: // Will be deleted
+ return " - ";
+ case S_Update: // Will be updated
+ return " > ";
+ case S_AutoInstall: // Will be automatically installed
+ return " a+ ";
+ case S_AutoDel: // Will be automatically deleted
+ return " a- ";
+ case S_AutoUpdate: // Will be automatically updated
+ return " a> ";
+ case S_Taboo: // Never install this
+ return " ---";
+ case S_Protected: // always keep installed version
+ return " -i-";
+ default:
+ return "####";
+ }
+
+ return " ";
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgTable::NCPkgTable
+// METHOD TYPE : Constructor
+//
+// DESCRIPTION :
+//
+NCPkgTable::NCPkgTable( YWidget * parent, YTableHeader * tableHeader )
+ : NCTable( parent, tableHeader )
+ , packager ( 0 )
+ , statusStrategy( new PackageStatStrategy ) // default strategy: packages
+ , tableType ( T_Packages ) // default type: packages
+ , haveInstalledVersion ( false )
+{
+ fillHeader();
+
+ WIDDBG << endl;
+}
+
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgTable::~NCPkgTable
+// METHOD TYPE : Destructor
+//
+// DESCRIPTION :
+//
+NCPkgTable::~NCPkgTable()
+{
+ delete statusStrategy;
+ WIDDBG << endl;
+}
+
+
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgTable::addLine
+// METHOD TYPE : void
+//
+// DESCRIPTION :
+//
+void NCPkgTable::addLine( ZyppStatus stat,
+ const vector<string> & elements,
+ ZyppObj objPtr,
+ ZyppSel slbPtr )
+{
+ vector Items( elements.size()+1, 0 );
+
+ // fill first column (containing the status information and the package pointers)
+ Items[0] = new NCPkgTableTag( objPtr, slbPtr, stat );
+
+ for ( unsigned i = 1; i < elements.size()+1; ++i ) {
+ // use YCPString to enforce recoding from 'utf8'
+ Items[i] = new NCTableCol( YCPString( elements[i-1] ) );
+ }
+ myPad()->Append( Items );
+
+ // don't call DrawPad(); for every line - is called once after the loop
+
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgTable::deleteAllItems
+// METHOD TYPE : void
+//
+// DESCRIPTION :
+//
+void NCPkgTable::itemsCleared()
+{
+ return NCTable::deleteAllItems();
+}
+
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgTable::cellChanged
+// METHOD TYPE : void
+//
+// DESCRIPTION :
+//
+void NCPkgTable::cellChanged( int index, int colnum, const string & newtext )
+{
+ return NCTable::cellChanged( index, colnum, newtext );
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgTable::changeStatus
+// METHOD TYPE : bool
+//
+// DESCRIPTION : sets the new status in first column of the package table
+// and informs the package manager
+//
+bool NCPkgTable::changeStatus( ZyppStatus newstatus,
+ const ZyppSel & slbPtr,
+ // objPtr is candidatePtr or what the user selected instead of it.
+ ZyppObj objPtr,
+ bool singleChange )
+{
+ if ( !packager || !slbPtr )
+ return false;
+
+ zypp::Text notify;
+ zypp::License license;
+ bool license_confirmed = true;
+ ZyppPkg pkgPtr = NULL;
+ string header;
+ bool ok = true;
+ int cols = NCurses::cols();
+ int lines = NCurses::lines();
+
+ switch ( newstatus )
+ {
+ case S_Del:
+ case S_NoInst:
+ case S_Taboo:
+ if ( objPtr )
+ {
+ notify = objPtr->delnotify();
+ NCDBG << "DELETE message: " << notify << endl;
+ header = NCPkgNames::WarningLabel();
+ }
+ break;
+ //display notify msg only if we mark pkg for installation
+ //disregard update, to be consistent with Qt (#308410)
+ case S_Install:
+ if ( objPtr )
+ {
+ notify = objPtr->insnotify();
+ NCDBG << "NOTIFY message: " << notify << endl;
+ header = NCPkgNames::NotifyLabel();
+ }
+ case S_Update:
+ case S_AutoInstall:
+ case S_AutoUpdate:
+ if ( objPtr )
+ {
+ // check license of packages and patches in case of S_Install/S_Update/S_AutoInstall/S_AutoUpdate
+ license = objPtr->licenseToConfirm();
+ license_confirmed = slbPtr->hasLicenceConfirmed();
+ }
+ break;
+
+ default: break;
+ }
+
+ string pkgName = slbPtr->name();
+
+ if ( !license.empty() )
+ {
+ if (!license_confirmed)
+ {
+ NCPopupInfo * info = new NCPopupInfo( wpos( (lines * 10)/100, (cols * 10) /100),
+ NCPkgNames::NotifyLabel(),
+ string( _("End User License Agreement") +
+ "<i>" + pkgName + "</i><br><br>" + packager->createDescrText( license ) ),
+ NCPkgNames::AcceptLabel(),
+ NCPkgNames::CancelLabel()
+ );
+ info->setNiceSize( (NCurses::cols() * 80)/100, (NCurses::lines()*80)/100);
+ license_confirmed = info->showInfoPopup( ) != NCursesEvent::cancel;
+
+ YDialog::deleteTopmostDialog();
+
+ }
+
+ if ( !license_confirmed )
+ {
+ // make sure the package won't be installed
+ switch ( newstatus )
+ {
+ case S_Install:
+ case S_AutoInstall:
+ newstatus = S_Taboo;
+ break;
+
+ case S_Update:
+ case S_AutoUpdate:
+ newstatus = S_Protected;
+ break;
+
+ default:
+ break;
+ }
+
+ ok = false;
+ } else {
+ NCMIL << "User confirmed license agreement for " << pkgName << endl;
+ slbPtr->setLicenceConfirmed (true);
+ }
+ }
+
+ if ( ok && !notify.empty() )
+ {
+ NCPopupInfo * info = new NCPopupInfo( wpos( (lines * 35)/100, (cols * 25)/100),
+ header,
+ "<i>" + pkgName + "</i><br><br>" + packager->createDescrText( notify )
+ );
+ info->setNiceSize( (NCurses::cols() * 50)/100, (NCurses::lines() * 30)/100);
+ info->showInfoPopup( );
+
+ YDialog::deleteTopmostDialog();
+ }
+
+ // inform the package manager
+ ok = statusStrategy->setObjectStatus( newstatus, slbPtr, objPtr );
+
+ if ( ok && singleChange )
+ {
+ switch ( tableType )
+ {
+ case T_Packages:
+ case T_PatchPkgs:
+ case T_Update:
+ // check/show dependencies of packages
+ packager->showPackageDependencies( false ); // only check if automatic check is ON
+ // show the required diskspace
+ packager->showDiskSpace();
+ break;
+ case T_Availables:
+ // check/show dependencies of packages
+ packager->showPackageDependencies( false );
+ // don't show diskspace (type T_Availables is also used in YOU mode)
+ break;
+ case T_Selections:
+ // check/show dependencies of selections
+ packager->showSelectionDependencies();
+ packager->showDiskSpace();
+ break;
+
+ case T_Patches:
+ // show the download size for all selected patches
+ packager->showDownloadSize();
+ break;
+
+ default:
+ break;
+ }
+ // update this list to show the status changes
+ updateTable();
+
+ if ( tableType == T_Availables )
+ {
+ // additionally update the package list
+ packager->updatePackageList();
+ }
+ }
+
+ return ok;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgTable::updateTable
+// METHOD TYPE : bool
+//
+// DESCRIPTION : set the new status info if status has changed
+//
+bool NCPkgTable::updateTable()
+{
+ unsigned int size = getNumLines();
+ unsigned int index = 0;
+ bool ret = true;
+
+ while ( index < size )
+ {
+ // get the table line
+ NCTableLine * cl = myPad()->ModifyLine( index );
+ if ( !cl )
+ {
+ ret = false;
+ break;
+ }
+
+ // get first column (the column containing the status info)
+ NCPkgTableTag * cc = static_cast( cl->GetCol( 0 ) );
+ // get the object pointer
+ ZyppSel slbPtr = getSelPointer( index );
+ ZyppObj objPtr = getDataPointer( index );
+
+ if ( !cc )
+ {
+ ret = false;
+ break;
+ }
+
+ ZyppStatus newstatus = S_NoInst;
+ if ( slbPtr && objPtr)
+ {
+ if ( tableType == T_Availables )
+ {
+ string isCandidate = " ";
+ if ( objPtr == slbPtr->candidateObj() )
+ isCandidate = " x ";
+
+ cl->AddCol( 2, new NCTableCol( isCandidate ) );
+ }
+ else
+ {
+ // get the new status and replace old status
+ newstatus = statusStrategy->getPackageStatus( slbPtr, objPtr );
+
+ // set new status (if status has changed)
+ if ( getStatus(index) != newstatus )
+ {
+ cc->setStatus( newstatus );
+ }
+ }
+ }
+ index++;
+ }
+
+ DrawPad();
+
+ return ret;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// slbHasInstalledObj
+//
+// a helper to call a method
+//
+static bool slbHasInstalledObj (const ZyppSel & slb)
+{
+ return slb->hasInstalledObj ();
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// fillHeader
+//
+// Fillup the column headers of the package table
+//
+void NCPkgTable::fillHeader( )
+{
+ vector<string> header;
+
+ switch ( tableType )
+ {
+ case T_Packages:
+ case T_Update: {
+ bool haveInstalledPkgs = find_if (zyppPkgBegin (), zyppPkgEnd (),
+ slbHasInstalledObj) != zyppPkgEnd ();
+
+ header.reserve(7);
+ header.push_back( "L" + NCPkgNames::PkgStatus() );
+ header.push_back( "L" + NCPkgNames::PkgName() );
+ if ( haveInstalledPkgs > 0 )
+ {
+ header.push_back( "L" + NCPkgNames::PkgVersionNew() );
+ header.push_back( "L" + NCPkgNames::PkgVersionInst() );
+ haveInstalledVersion = true;
+ }
+ else
+ {
+ header.push_back( "L" + NCPkgNames::PkgVersion() );
+ }
+ header.push_back( "L" + NCPkgNames::PkgSummary() );
+ header.push_back( "L" + NCPkgNames::PkgSize() );
+// installation of source rpms is not possible
+#ifdef FIXME
+ header.push_back( "L" + NCPkgNames::PkgSource() );
+#endif
+ break;
+ }
+ case T_PatchPkgs: {
+ header.reserve(7);
+ header.push_back( "L" + NCPkgNames::PkgStatus() );
+ header.push_back( "L" + NCPkgNames::PkgName() );
+ header.push_back( "L" + NCPkgNames::PkgVersionNew() );
+ header.push_back( "L" + NCPkgNames::PkgVersionInst() );
+ header.push_back( "L" + NCPkgNames::PkgSummary() );
+ header.push_back( "L" + NCPkgNames::PkgSize() );
+ break;
+ }
+ case T_Patches: {
+ header.reserve(6);
+ header.push_back( "L" + NCPkgNames::PkgStatus() );
+ header.push_back( "L" + NCPkgNames::PkgName() );
+ header.push_back( "L" + NCPkgNames::PkgSummary() );
+ header.push_back( "L" + NCPkgNames::PatchKind() );
+ header.push_back( "L" + NCPkgNames::PkgVersion() );
+ // header.push_back( "L" + NCPkgNames::PkgSize() );
+ break;
+ }
+ case T_Selections: {
+ header.reserve(3);
+ header.push_back( "L" + NCPkgNames::PkgStatus() );
+ header.push_back( "L" + NCPkgNames::SelectionLabel() );
+ break;
+ }
+ case T_Languages: {
+ header.reserve(4);
+ header.push_back( "L" + NCPkgNames::PkgStatus() );
+ header.push_back( "L" + NCPkgNames::LangCode() );
+ header.push_back( "L" + NCPkgNames::LangName() );
+ break;
+ }
+ case T_Availables: {
+ header.reserve(6);
+ header.push_back( "L" + NCPkgNames::PkgStatus() );
+ header.push_back( "L" + NCPkgNames::PkgName() );
+ header.push_back( "L" + NCPkgNames::PkgStatus() );
+ header.push_back( "L" + NCPkgNames::PkgVersion() );
+ header.push_back( "L" + NCPkgNames::PkgInstSource() );
+ header.push_back( "L" + NCPkgNames::PkgSize() );
+ header.push_back( "L" + NCPkgNames::PkgArch() );
+ break;
+ }
+ default: {
+ header.reserve(4);
+ header.push_back( "L" + NCPkgNames::PkgStatus() );
+ header.push_back( "L" + NCPkgNames::PkgName() );
+ header.push_back( "L" + NCPkgNames::PkgSummary() );
+ break;
+ }
+ }
+ setHeader( header );
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// createListEntry
+//
+//
+bool NCPkgTable::createListEntry ( ZyppPkg pkgPtr, ZyppSel slbPtr )
+{
+ vector<string> pkgLine;
+ pkgLine.reserve(6);
+
+ if ( !pkgPtr || !slbPtr )
+ {
+ NCERR << "No valid package available" << endl;
+ return false;
+ }
+
+ // add the package name
+ pkgLine.push_back( slbPtr->name() );
+
+ string instVersion = "";
+ string version = "";
+ ZyppStatus status;
+
+ switch( tableType )
+ {
+ case T_PatchPkgs: {
+ // if the package is installed, get the installed version
+ if ( slbPtr->hasInstalledObj() )
+ {
+ instVersion = slbPtr->installedObj()->edition().asString();
+ }
+ // if a candidate is available, get the candidate version
+ if ( slbPtr->hasCandidateObj() )
+ {
+ version = slbPtr->candidateObj()->edition().asString();
+ }
+ else
+ {
+ version = pkgPtr->edition().asString();
+ }
+ pkgLine.push_back( version );
+
+ // in case of YOU there are always installed packages
+ // => always add installed version (or empty column)
+ pkgLine.push_back( instVersion );
+
+ pkgLine.push_back( pkgPtr->summary() ); // short description
+
+ status = slbPtr->status(); // the package status
+ NCMIL << "Status of " << slbPtr->name() << ": " << status << endl;
+ zypp::ByteCount size = pkgPtr->size(); // installed size
+ pkgLine.push_back( size.asString( 8 ) ); // format size
+
+ break;
+ }
+ case T_Availables: {
+ string isCandidate = " ";
+ if ( pkgPtr == slbPtr->candidateObj() )
+ isCandidate = " x ";
+ pkgLine.push_back( isCandidate );
+
+ version = pkgPtr->edition().asString();
+ pkgLine.push_back( version );
+
+ // show the repository (the installation source)
+ pkgLine.push_back( pkgPtr->repository().info().alias() );
+
+ // set package status either to S_NoInst or S_KeepInstalled
+ status = S_NoInst;
+ if ( slbPtr->hasInstalledObj() )
+ {
+ if ( pkgPtr->edition() == slbPtr->installedObj()->edition() &&
+ pkgPtr->arch() == slbPtr->installedObj()->arch() )
+ {
+ status = S_KeepInstalled;
+ }
+ }
+
+ zypp::ByteCount size = pkgPtr->size(); // installed size
+ pkgLine.push_back( size.asString( 8 ) ); // format size
+ pkgLine.push_back( pkgPtr->arch().asString()); // architecture
+
+ break;
+ }
+ default: {
+ // version() was edition.version. but what about edition.release?
+
+ // if the package is installed, get the installed version
+ if ( slbPtr->hasInstalledObj() )
+ {
+ instVersion = slbPtr->installedObj()->edition().version();
+
+ // if a candidate is available, get the candidate version
+ if ( slbPtr->hasCandidateObj() )
+ {
+ version = slbPtr->candidateObj()->edition().version();
+ }
+ }
+ else
+ {
+ version = pkgPtr->edition().version();
+ }
+ pkgLine.push_back( version ); // the available version (the candidate)
+
+ if ( haveInstalledVersion )
+ {
+ pkgLine.push_back( instVersion ); // installed version
+ }
+ pkgLine.push_back( pkgPtr->summary() ); // short description
+
+ status = slbPtr->status(); // the package status
+
+ zypp::ByteCount size = pkgPtr->size(); // installed size
+ pkgLine.push_back( size.asString( 8 ) ); // format size
+
+// Selectable does not have source_install
+#ifdef FIXME
+ if ( slbPtr->source_install() )
+ {
+ pkgLine.push_back( " x " );
+ }
+ else
+#endif
+ {
+ pkgLine.push_back( " " );
+ }
+ }
+ }
+
+ addLine( status, // the package status
+ pkgLine, // the package data
+ pkgPtr, // the corresponding package pointer
+ slbPtr
+ );
+
+ return true;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// createInfoEntry
+//
+//
+bool NCPkgTable::createInfoEntry ( string text )
+{
+ vector<string> pkgLine;
+ pkgLine.reserve(2);
+
+ pkgLine.push_back( text );
+ addLine( S_NoInst, // use status NoInst
+ pkgLine,
+ ZyppObj(),
+ ZyppSel()); // null pointer
+
+ return true;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// createPatchEntry
+//
+//
+bool NCPkgTable::createPatchEntry ( ZyppPatch patchPtr, ZyppSel selectable )
+{
+ vector<string> pkgLine;
+ pkgLine.reserve(5);
+
+ if ( !patchPtr || !selectable )
+ {
+ NCERR << "No valid patch available" << endl;
+ return false;
+ }
+
+ pkgLine.push_back( selectable->name() ); // show the patch name
+
+ if ( !patchPtr->summary().empty() )
+ pkgLine.push_back( patchPtr->summary() ); // short description
+ else
+ pkgLine.push_back( selectable->name() ); // name
+
+ pkgLine.push_back( patchPtr->category() ); // patch kind
+ pkgLine.push_back( patchPtr->edition().asString() ); // patch version
+
+ // zypp::ByteCount size = patchPtr->size();
+ // pkgLine.push_back( size.asString( 8 ) );
+
+
+ addLine( selectable->status(), // get the status
+ pkgLine,
+ patchPtr,
+ selectable ); // the corresponding pointer
+
+ return true;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// showInformation
+//
+//
+bool NCPkgTable::showInformation ( )
+{
+ ZyppObj objPtr = getDataPointer( getCurrentItem() );
+ ZyppSel slbPtr = getSelPointer( getCurrentItem() );
+
+ if ( !packager )
+ return false;
+
+ switch ( tableType )
+ {
+ case T_Packages:
+ case T_Update:
+ // show the required package info
+ packager->showPackageInformation( objPtr, slbPtr );
+ break;
+ case T_Patches:
+ // show the patch info
+ packager->showPatchInformation( objPtr, slbPtr );
+ break;
+ default:
+ break;
+ }
+
+ return true;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgTable::wHandleInput
+// METHOD TYPE : NCursesEvent
+//
+// DESCRIPTION :
+//
+NCursesEvent NCPkgTable::wHandleInput( wint_t key )
+{
+ NCursesEvent ret = NCursesEvent::none;
+
+ // call handleInput of NCPad
+ handleInput( key );
+
+ switch ( key )
+ {
+ case KEY_UP:
+ case KEY_DOWN:
+ case KEY_NPAGE:
+ case KEY_PPAGE:
+ case KEY_END:
+ case KEY_HOME: {
+ // show the corresponding information
+ showInformation( );
+ ret = NCursesEvent::handled;
+ break;
+ }
+ case KEY_SPACE:
+ case KEY_RETURN: {
+ // toggle status
+ toggleObjStatus( );
+
+ ret = NCursesEvent::handled;
+ break;
+ }
+ default: {
+ // set the new status
+ changeObjStatus( key );
+
+ ret = NCursesEvent::handled;
+ break;
+ }
+ }
+
+ return ret;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// NCPkgTable::getStatus()
+//
+// Gets the status of the package of selected line
+//
+ZyppStatus NCPkgTable::getStatus( int index )
+{
+ // get the tag
+ NCPkgTableTag * cc = getTag( index);
+ if ( !cc )
+ return S_NoInst;
+
+ return cc->getStatus();
+}
+
+ZyppObj NCPkgTable::getDataPointer( int index )
+{
+ // get the tag
+ NCPkgTableTag *cc = getTag( index );
+ if ( !cc )
+ return ZyppObj( );
+
+ return cc->getDataPointer();
+}
+
+ZyppSel NCPkgTable::getSelPointer( int index )
+{
+ // get the tag
+ NCPkgTableTag *cc = getTag( index );
+ if ( !cc )
+ return ZyppSel( );
+
+ return cc->getSelPointer();
+}
+
+NCPkgTableTag * NCPkgTable::getTag( const int & index )
+{
+ // get the table line
+ NCTableLine * cl = myPad()->ModifyLine( index );
+ if ( !cl )
+ return 0;
+
+ // get first column (the column containing the status info)
+ NCPkgTableTag * cc = static_cast( cl->GetCol( 0 ) );
+
+ return cc;
+}
+
+#ifdef FIXME
+///////////////////////////////////////////////////////////////////
+//
+// NCPkgTable::SourceInstall()
+//
+//
+bool NCPkgTable::SourceInstall( bool install )
+{
+ int index = getCurrentItem();
+ ZyppObj objPtr = getDataPointer( index );
+ bool ok;
+
+ if ( !objPtr )
+ {
+ NCERR << "Invalid Pointer" << endl;
+ return false;
+ }
+ ZyppSel selPtr = objPtr->getSelectable();
+ NCTableLine * currentLine = myPad()->ModifyLine( index );
+
+ if ( !selPtr || !currentLine )
+ {
+ NCERR << "Invalid Selectable" << endl;
+ return false;
+ }
+
+ NCTableCol * currentCol = currentLine->GetCol( currentLine->Cols()-1 );
+
+ if ( install && selPtr->providesSources() )
+ {
+ ok = selPtr->set_source_install( true );
+ NCMIL << "Set source install returns: " << (ok?"true":"false") << endl;
+ if ( currentCol )
+ currentCol->SetLabel( NClabel( " x " ) );
+ }
+ else if ( !install && selPtr->source_install() )
+ {
+ ok = selPtr->set_source_install( false );
+ NCMIL << "ReSet source install returns: " << (ok?"true":"false") << endl;
+ if ( currentCol )
+ currentCol->SetLabel( NClabel( " " ) );
+ }
+
+ return true;
+}
+#endif
+
+///////////////////////////////////////////////////////////////////
+//
+// NCPkgTable::toggleObjStatus()
+//
+//
+bool NCPkgTable::toggleObjStatus( )
+{
+ ZyppSel slbPtr = getSelPointer( getCurrentItem() );
+ ZyppObj objPtr = getDataPointer( getCurrentItem() );
+
+ if ( !slbPtr )
+ return false;
+
+ ZyppStatus newStatus;
+
+ bool ok = statusStrategy->toggleStatus( slbPtr, objPtr, newStatus );
+
+ if ( ok )
+ {
+ changeStatus( newStatus, slbPtr, objPtr, true );
+ }
+
+ return true;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// NCPkgTable::changeObjStatus()
+//
+//
+bool NCPkgTable::changeObjStatus( int key )
+{
+ ZyppSel slbPtr = getSelPointer( getCurrentItem() );
+ ZyppObj objPtr = getDataPointer( getCurrentItem() );
+
+ if ( !slbPtr )
+ {
+ return false;
+ }
+ ZyppStatus newStatus;
+
+ bool ok = statusStrategy->keyToStatus( key, slbPtr, objPtr, newStatus );
+
+ if ( ok )
+ {
+ changeStatus( newStatus, slbPtr, objPtr, true );
+ }
+ return true;
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// NCPkgTable::changeListObjStatus()
+//
+//
+bool NCPkgTable::changeListObjStatus( NCPkgTableListAction type )
+{
+ ZyppStatus newStatus;
+ unsigned int size = getNumLines();
+ unsigned int index = 0;
+
+ while ( index < size )
+ {
+ // get the object pointer
+ ZyppSel slbPtr = getSelPointer( index );
+ ZyppObj objPtr = getDataPointer( index );
+ bool ok = false;
+
+ if ( slbPtr )
+ {
+ switch ( type ) {
+ case A_Install: {
+ if ( slbPtr->status() == S_NoInst )
+ ok = statusStrategy->keyToStatus( '+', slbPtr, objPtr, newStatus );
+ break;
+ }
+ case A_DontInstall: {
+ if ( slbPtr->status() == S_Install
+ || slbPtr->status() == S_AutoInstall )
+ ok = statusStrategy->keyToStatus( '<', slbPtr, objPtr, newStatus );
+ break;
+ }
+ case A_Delete: {
+ if ( slbPtr->status() == S_KeepInstalled )
+ ok = statusStrategy->keyToStatus( '-', slbPtr, objPtr, newStatus );
+ break;
+ }
+ case A_DontDelete: {
+ if ( slbPtr->status() == S_Del
+ || slbPtr->status() == S_AutoDel )
+ ok = statusStrategy->keyToStatus( '+', slbPtr, objPtr, newStatus );
+ break;
+ }
+ case A_UpdateNewer: {
+ if ( slbPtr->status() == S_KeepInstalled && slbPtr->hasCandidateObj() ) {
+ if ( slbPtr->installedObj()->edition() < slbPtr->candidateObj()->edition() )
+ ok = statusStrategy->keyToStatus( '>', slbPtr, objPtr, newStatus );
+ }
+ break;
+ }
+ case A_Update: {
+ if ( slbPtr->status() == S_KeepInstalled )
+ ok = statusStrategy->keyToStatus( '>', slbPtr, objPtr, newStatus );
+ break;
+ }
+ case A_DontUpdate: {
+ if ( slbPtr->status() == S_Update
+ || slbPtr->status() == S_AutoUpdate )
+ ok = statusStrategy->keyToStatus( '<', slbPtr, objPtr, newStatus );
+ break;
+ }
+ default:
+ NCERR << "Unknown list action" << endl;
+ }
+
+ if ( ok )
+ {
+ changeStatus( newStatus,
+ slbPtr,
+ objPtr,
+ false ); // do not do the updates with every change
+ }
+ }
+
+ index++;
+ }
+
+ // do the updates now
+ packager->showPackageDependencies( false );
+ packager->showDiskSpace();
+
+ updateTable();
+
+ return true;
+}
Added: branches/tmp/bubli/ncurses-pkg/src/NCPkgTable.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/NCPkgTable.h?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/src/NCPkgTable.h (added)
+++ branches/tmp/bubli/ncurses-pkg/src/NCPkgTable.h Fri Feb 8 13:59:32 2008
@@ -0,0 +1,320 @@
+/*-----------------------------------------------------------*- c++ -*-\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: NCPkgTable.h
+
+ Author: Gabriele Strattner
+ Maintainer: Michael Andres
+
+/-*/
+#ifndef NCPkgTable_h
+#define NCPkgTable_h
+
+#include <iosfwd>
+
+#include "NCPadWidget.h"
+#include "NCTablePad.h"
+#include "NCTable.h"
+
+#include <map>
+#include <string>
+#include <utility> // for STL pair
+
+#include
+
+#include "NCPkgStatusStrategy.h"
+
+
+class NCPackageSelector;
+
+
+/**
+ * This class is used for the first column of the package table
+ * which contains the status information of the package (installed,
+ * not installed, to be deleted and so on).
+ *
+ **/
+class NCPkgTableTag : public NCTableCol {
+
+ private:
+
+ ZyppStatus status;
+ ZyppObj dataPointer;
+ // cannot get at it from dataPointer
+ ZyppSel selPointer;
+
+ // returns the corresponding string value to given package status
+ string statusToStr( ZyppStatus stat ) const;
+
+ public:
+
+ NCPkgTableTag( ZyppObj pkgPtr,
+ ZyppSel selPtr,
+ ZyppStatus stat = S_NoInst );
+
+ virtual ~NCPkgTableTag() {}
+
+ virtual void DrawAt( NCursesWindow & w, const wrect at,
+ NCTableStyle & tableStyle,
+ NCTableLine::STATE linestate,
+ unsigned colidx ) const;
+
+ void setStatus( ZyppStatus stat ) { status = stat; }
+ ZyppStatus getStatus() const { return status; }
+ ZyppObj getDataPointer() const { return dataPointer; }
+ ZyppSel getSelPointer() const { return selPointer; }
+};
+
+/**
+ * The package table class. Provides methods to fill the table,
+ * set the status info and so on.
+ * Has a connection to the PackageSelector which is used to do
+ * changes which affect other widgets.
+ *
+ **/
+class NCPkgTable : public NCTable {
+
+public:
+ enum NCPkgTableType {
+ T_Packages,
+ T_Availables,
+ T_Patches,
+ T_Update,
+ T_PatchPkgs,
+ T_Selections,
+ T_Languages,
+ T_Unknown
+ };
+
+ enum NCPkgTableListAction {
+ A_Install,
+ A_DontInstall,
+ A_Delete,
+ A_DontDelete,
+ A_UpdateNewer,
+ A_Update,
+ A_DontUpdate,
+ A_Unknown
+ };
+
+ enum NCPkgTableListType {
+ L_Changes,
+ L_Installed,
+ L_Unknown
+ };
+
+private:
+
+ NCPkgTable & operator=( const NCPkgTable & );
+ NCPkgTable ( const NCPkgTable & );
+
+ NCPackageSelector * packager; // connection to the PackageSelector,
+
+ NCPkgStatusStrategy * statusStrategy; // particular methods to get the status
+
+ NCPkgTableType tableType; // the type (e.g. table of packages, patches)
+ bool haveInstalledVersion; // for T_Packages and T_Update
+
+ // returns the first column of line with 'index' (the tag)
+ NCPkgTableTag * getTag ( const int & index );
+
+protected:
+
+
+public:
+
+ /**
+ * Constructor
+ */
+ NCPkgTable( YWidget * parent, YTableHeader * tableHeader );
+
+ virtual ~NCPkgTable();
+
+
+ /**
+ * This method is called to add a line to the package list.
+ * @param status The package status (first column of the table)
+ * @param elements A vector<string> containing the package data
+ * @param objPtr The pointer to the packagemanager object
+ * @param objPtr The pointer to the selectable object
+ * @return void
+ */
+ virtual void addLine( ZyppStatus status,
+ const vector<string> & elements,
+ ZyppObj objPtr,
+ ZyppSel slbPtr );
+
+ /**
+ * Draws the package list (has to be called after the loop with addLine() calls)
+ */
+ void drawList( ) { return DrawPad(); }
+
+ /**
+ * Clears the package list
+ */
+ virtual void itemsCleared();
+
+ /**
+ * Changes the contents of a certain cell in table
+ * @param index The table line
+ * @param column The column
+ * @param newtext The new text
+ * @eturn void
+ */
+ virtual void cellChanged( int index, int colnum, const string & newtext );
+
+ /**
+ * Returns the contents of a certain cell in table
+ * @param index The table line
+ * @param column The column
+ * @eturn NClabel
+ */
+ NClabel getCellContents( int index, int colnum );
+
+ /**
+ * Handles the events concerning the package table (e.g. scroll the list,
+ * change the package status, ...)
+ * @param key The key which is pressed
+ * @return NCursesEvent
+ */
+ virtual NCursesEvent wHandleInput( wint_t key );
+
+ /**
+ * Sets the member variable PackageSelector *packager
+ * @param pkg The PackageSelector pointer
+ * @return void
+ */
+ void setPackager( NCPackageSelector * pkg ) { packager = pkg; }
+
+ /**
+ * Informs the package manager about the status change of
+ * the currently selected package and updates the states
+ * of all packages in the list
+ * @param newstat The new status
+ * @param slbPtr The pointer to the object to change
+ * @param objPtr is candidatePtr or what the user selected instead of it.
+ * @return bool
+ */
+ bool changeStatus( ZyppStatus newstat,
+ const ZyppSel & slbPtr,
+ ZyppObj objPtr,
+ bool singleChange );
+
+ bool changeObjStatus( int key );
+
+ bool changeListObjStatus( NCPkgTableListAction key );
+
+ bool toggleObjStatus( );
+
+ /**
+ * Set the status information if status has changed
+ * @return bool
+ */
+ bool updateTable();
+
+ /**
+ * Gets the currently displayed package status.
+ * @param index The index in package table (the line)
+ * @return ZyppStatus
+ */
+ ZyppStatus getStatus( int index );
+
+#ifdef FIXME
+ /**
+ * Toggles the installation of the source package.
+ * @param install
+ * @return bool
+ */
+ bool SourceInstall( bool install );
+#endif
+
+ /**
+ * Sets the type of the table and the status strategy (which means call particular methods
+ * to set/get the status for different zypp::ResObjects (zypp::Patch, zypp::Package or available zypp::Package)
+ * @param type The type (see enum NCPkgTableType)
+ * @param strategy The certain strategy (available strategies see NCPkgStatusStrategy.h).
+ * Has to be allocated with new - is deleted by NCPkgTable.
+ * @return bool
+ */
+ bool setTableType( NCPkgTableType type, NCPkgStatusStrategy * strategy ) {
+ if ( !strategy )
+ return false;
+
+ delete statusStrategy;
+ statusStrategy = strategy;
+ tableType = type;
+
+ return true;
+ }
+
+ NCPkgTableType getTableType() { return tableType; }
+
+ /**
+ * Gets the data pointer of a certain package.
+ * @param index The index in package table (the line)
+ * @return ZyppObj
+ */
+ ZyppObj getDataPointer( int index );
+
+ /**
+ * Gets the selectable pointer of a certain package.
+ * @param index The index in package table (the line)
+ * @return ZyppSel
+ */
+ ZyppSel getSelPointer( int index );
+
+ /**
+ * Returns the number of lines in the table (the table size)
+ * @return unsigned int
+ */
+ unsigned int getNumLines( ) { return myPad()->Lines(); }
+
+ /**
+ * Fills the header of the table
+ * @return void
+ */
+ void fillHeader( );
+
+ /**
+ * Creates a line in the package table.
+ * @param pkgPtr The package pointer
+ * @param slbPtr The selectable pointer
+ * @return bool
+ */
+ bool createListEntry ( ZyppPkg pkgPtr, ZyppSel slbPtr );
+
+ /**
+ * Creates a line in the YOU patch table.
+ * @param pkgPtr The YOU patch pointer
+ * @return bool
+ */
+ bool createPatchEntry ( ZyppPatch pkgPtr, ZyppSel slbPtr );
+
+ /**
+ * Creates a line in the table shwing an info text.
+ * @param text The information
+ * @return bool
+ */
+ bool createInfoEntry ( string text );
+
+ /**
+ * Show the corresponding information (e.g. the package description).
+ * @return bool
+ */
+ bool showInformation ( );
+
+
+};
+
+///////////////////////////////////////////////////////////////////
+
+#endif // NCPkgTable_h
Added: branches/tmp/bubli/ncurses-pkg/src/NCZypp.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/NCZypp.h?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/src/NCZypp.h (added)
+++ branches/tmp/bubli/ncurses-pkg/src/NCZypp.h Fri Feb 8 13:59:32 2008
@@ -0,0 +1,139 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: NCZypp.h
+
+ Author: Stefan Hundhammer
+
+/-*/
+
+// -*- c++ -*-
+
+#ifndef NCZypp_h
+#define NCZypp_h
+
+#include <set>
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+
+using zypp::ui::S_Protected;
+using zypp::ui::S_Taboo;
+using zypp::ui::S_Del;
+using zypp::ui::S_Update;
+using zypp::ui::S_Install;
+using zypp::ui::S_AutoDel;
+using zypp::ui::S_AutoUpdate;
+using zypp::ui::S_AutoInstall;
+using zypp::ui::S_KeepInstalled;
+using zypp::ui::S_NoInst;
+
+
+//
+// Typedefs to make those nested namespaces human-readable
+//
+
+typedef zypp::ui::Status ZyppStatus;
+typedef zypp::ui::Selectable::Ptr ZyppSel;
+typedef zypp::ResObject::constPtr ZyppObj;
+typedef zypp::Package::constPtr ZyppPkg;
+typedef zypp::Selection::constPtr ZyppSelection;
+typedef zypp::Pattern::constPtr ZyppPattern;
+typedef zypp::Language::constPtr ZyppLang;
+typedef zypp::Patch::constPtr ZyppPatch;
+typedef zypp::Product::constPtr ZyppProduct;
+typedef zypp::Repository ZyppRepo;
+
+typedef zypp::ResPoolProxy ZyppPool;
+typedef zypp::ResPoolProxy::const_iterator ZyppPoolIterator;
+typedef zypp::ResPoolProxy::repository_iterator ZyppRepositoryIterator;
+
+
+inline ZyppPool zyppPool() { return zypp::getZYpp()->poolProxy(); }
+
+template<class T> ZyppPoolIterator zyppBegin() { return zyppPool().byKindBegin<T>(); }
+template<class T> ZyppPoolIterator zyppEnd() { return zyppPool().byKindEnd<T>(); }
+
+inline ZyppPoolIterator zyppPkgBegin() { return zyppBeginzypp::Package(); }
+inline ZyppPoolIterator zyppPkgEnd() { return zyppEndzypp::Package(); }
+
+inline ZyppPoolIterator zyppSelectionsBegin() { return zyppBeginzypp::Selection(); }
+inline ZyppPoolIterator zyppSelectionsEnd() { return zyppEndzypp::Selection(); }
+
+inline ZyppPoolIterator zyppPatternsBegin() { return zyppBeginzypp::Pattern(); }
+inline ZyppPoolIterator zyppPatternsEnd() { return zyppEndzypp::Pattern(); }
+
+inline ZyppPoolIterator zyppLangBegin() { return zyppBeginzypp::Language(); }
+inline ZyppPoolIterator zyppLangEnd() { return zyppEndzypp::Language(); }
+
+inline ZyppPoolIterator zyppPatchesBegin() { return zyppBeginzypp::Patch(); }
+inline ZyppPoolIterator zyppPatchesEnd() { return zyppEndzypp::Patch(); }
+
+inline ZyppPoolIterator zyppProductsBegin() { return zyppBeginzypp::Product(); }
+inline ZyppPoolIterator zyppProductsEnd() { return zyppEndzypp::Product(); }
+
+inline ZyppRepositoryIterator ZyppRepositoriesBegin() { return zyppPool().knownRepositoriesBegin(); }
+inline ZyppRepositoryIterator ZyppRepositoriesEnd() { return zyppPool().knownRepositoriesEnd(); }
+
+
+inline ZyppPkg tryCastToZyppPkg( ZyppObj zyppObj )
+{
+ return zypp::dynamic_pointer_cast<const zypp::Package>( zyppObj );
+}
+
+inline ZyppSelection tryCastToZyppSelection( ZyppObj zyppObj )
+{
+ return zypp::dynamic_pointer_cast<const zypp::Selection>( zyppObj );
+}
+
+inline ZyppPattern tryCastToZyppPattern( ZyppObj zyppObj )
+{
+ return zypp::dynamic_pointer_cast<const zypp::Pattern>( zyppObj );
+}
+
+inline ZyppLang tryCastToZyppLang( ZyppObj zyppObj )
+{
+ return zypp::dynamic_pointer_cast<const zypp::Language>( zyppObj );
+}
+
+inline ZyppPatch tryCastToZyppPatch( ZyppObj zyppObj )
+{
+ return zypp::dynamic_pointer_cast<const zypp::Patch>( zyppObj );
+}
+
+inline ZyppProduct tryCastToZyppProduct( ZyppObj zyppObj )
+{
+ return zypp::dynamic_pointer_cast<const zypp::Product>( zyppObj );
+}
+
+template<typename T> bool inContainer( const std::set<T> & container, T search )
+{
+ return container.find( search ) != container.end();
+}
+
+
+template<typename T> bool bsearch( const std::vector<T> & sorted_vector, T search )
+{
+ return binary_search( sorted_vector.begin(), sorted_vector.end(), search);
+}
+
+
+#endif // NCZypp_h
Added: branches/tmp/bubli/ncurses-pkg/src/pkg_layout.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/pkg_layout.ycp?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/src/pkg_layout.ycp (added)
+++ branches/tmp/bubli/ncurses-pkg/src/pkg_layout.ycp Fri Feb 8 13:59:32 2008
@@ -0,0 +1,166 @@
+/**
+ * File: pkg_layout.ycp
+ * Package:
+ * Authors: Gabriele Strattner
+ *
+ * Purpose:
+ *
+ * ncurses layout for package selection
+ *
+ * $Id: pkg_layout.ycp 39443 2007-07-16 14:30:49Z kmachalkova $
+ */
+{
+ textdomain "packages";
+
+ return `VBox( `VSpacing(0.3),
+ `HBox( `HSpacing(0.3),
+ // label of the Filter menu ( keep it short ) - filters out a set of packages
+ `Left(`ReplacePoint(`id(`replacefilter),`MenuButton( `opt(`key_F4), _( "&Filter" ),
+ // begin: menu items of the filter menu
+ // please note: use unique hotkeys until end:
+ [`item( `id("groups"), _( "RPM &Groups" ) ),
+ `item( `id("patterns"), _( "Pa&tterns" ) ),
+ `item( `id("languages"), _( "&Languages" ) ),
+ `item( `id("repos"), _( "&Repositories") ),
+ `item( `id("search"), _( "&Search" ) ),
+ `item( `id("installed"), _( "Installed &Packages" ) ),
+ `item( `id("whatif"), _( "&Installation Summary" ) ),
+ // end: menu items of the filter menu
+ `item( `id("updatelist"), _( "&Update List" ) ) ]
+ )
+ )
+ ),
+ // label Actions menu ( keep it short ) - actions to change status of a package
+ `Left(`MenuButton( `opt(`key_F5), _( "A&ctions" ),
+ // Please note: add an appropriate number of whitespaces to get a well
+ // formated menu (the [ ]s should be in one column) and use unique hotkeys until end:
+ // begin: Actions menu, toggle the status, e.g. change from installed to delete
+ [`item( `id("toggle"), _( "&Toggle [SPACE]" ) ),
+ // select the package for installation
+ `item( `id("select"), _( "&Select [+]" ) ),
+ // delete the package
+ `item( `id("delete"), _( "&Delete [-]" ) ),
+ // update the package
+ `item( `id("update"), _( "&Update [>]" ) ),
+ // set package status to 'Taboo', i.e. never install this package
+ `item( `id("tabooOn"), _( "Taboo &Yes [!]" ) ),
+ // reset the status 'Taboo'
+ `item( `id("tabooOff"), _( "Taboo &No [%]" ) ),
+/*#ifdef FIXME
+// source package handling does not work yet with zypp
+ // install the source package (SRPM)
+ `item( `id("sourceYes"), _( "&Install Sources (SRPM)" ) ),
+ // don't install sources
+ `item( `id("sourceNo"), _( "D&o Not Install Sources" ) ),
+#endif*/
+ // end: Actions menu, set status of all packages (title of a submenu)
+ `menu( _( "All Listed &Packages" ),
+ [
+ // begin: submenu items actions concerning all packages
+ // please note: use unique hotkeys until end:
+ `item(`id("selall"), _( "&Install All" ) ),
+ `item(`id("deselall"), _( "Do &Not Install Any" ) ),
+ `item(`id("delall"), _( "&Delete All" ) ),
+ `item(`id("dontdel"), _( "Do Not D&elete Any" ) ),
+ `item(`id("updnewer"), _( "&Update If Newer Version Available" ) ),
+ `item(`id("updall"), _( "U&pdate All Unconditionally") ),
+ // end: submenu items: actions concerning all packages
+ `item(`id("dontupd"), _( "Do Not Update and &Keep Installed" ) )
+ ]
+ )
+ ]
+ )),
+ // label Information menu ( keep it short! )
+ `Left(`MenuButton( `opt(`key_F6), _( "&Information" ),
+ // begin: menu items of the info menu
+ // please note: use unique hotkeys until end:
+ [`item( `id("pkginfo"), _( "&Package Info" ) ),
+ `item( `id("longdescr"), _( "&Long Description" ) ),
+ `item( `id("versions"), _( "&Versions" ) ),
+ `item( `id("files"), _( "&File List" ) ),
+ // end: menu items of the info menu
+ `item( `id("relations"), _( "Package &Relations" ) ) ]
+ )),
+ // label Etc. menu ( keep it short! )
+ `Left(`ReplacePoint(`id(`replacemenu), `MenuButton( `opt(`key_F7), _( "&Etc." ),
+ // menu item of the Etc. menu
+ [`menu( _( "&Dependencies" ),
+ // menu items of the Etc./Dependencies submenu
+ [`item( `id("showdeps"), _( " &Check Dependencies Now" ) ),
+ `item( `id("autodeps"), _( "[X] &Automatic Dependency Check" ) ),
+ `item( `id("verifysystem"), _( " &Verify System" ) ) ]
+ ),
+ // menu item - list of all packages in the system
+ `menu( _("All &Packages List"),
+ // action on list of all packages-export to xml file
+ [`item( `id("export"), _("&Export to File") ),
+ // action on list of all packages-import from xml file
+ `item( `id("import"), _("&Import from File") ) ]
+ ),
+ `item( `id("testcase"), _( "Generate Dependency Resolver &Test Case" ) )
+/*#ifdef FIXME
+ ,
+ // menu item of the Etc. menu
+ `menu( _( "&Selections" ),
+ // menu item of the Etc./Selections submenu
+ [`item( `id("save"), _( "S&ave Selection" ) ),
+ `item( `id("load"), _( "&Load Selection" ) ) ]
+ )
+#endif*/
+ ]
+ )
+ )
+ ),
+ `HSpacing(0.3)
+ ),
+ `VSpacing(0.3),
+ `VWeight( 50, `HBox(`HSpacing(0.3),
+ `PkgSpecial( `id("packages"), `opt(`notify), "pkgTable" ),
+ `HSpacing(0.3)
+ )
+ ),
+ // label text - keep it short
+ `HBox( `HWeight(1, `HBox(`Label( _( "Filter: " ) ),
+ `Label( `id("filter"), "..............................." ),
+ `HSpacing( 0.1 )
+ )
+ ),
+ // label text - keep it short (use abbreviation if necessary)
+ `HWeight(1, `HBox(`Label( _( "Required Disk Space: " ) ),
+ `Label( `id("diskspace"), " " ),
+ `HSpacing( 0.1 )
+ )
+ )
+ ),
+ `VBox(`VWeight( 40, `ReplacePoint( `id(`replaceinfo),
+ `RichText( `id("description")," ")
+ )
+ ),
+ `VWeight( 5, `HBox(
+ // label help menu
+ `HBox(`MenuButton(`opt(`key_F1), _( "&Help" ),
+ // menu items of the help menu
+ [`item( `id("help_general"), _( "&General Help" ) ),
+ `item( `id("help_status"), _( "Help on &Package Status" ) ),
+ `item( `id("help_search"), _( "Help on &Search" ) ),
+ `item( `id("help_update"), _( "Help on &Upate" ) ) ]
+ ),
+ `HWeight(1,`HStretch()),
+ // button label - keep it short
+ `PushButton(`id("search"), `opt(`key_F2), _( "&Search" ) ),
+ `HWeight(1, `HStretch()),
+ // button label - keep it short! (max. 15 chars -- use abbreviation)
+ `PushButton(`id("diskinfo"), `opt(`key_F3), _( "&Disk Usage" ) ),
+ `HWeight(1,`HStretch())
+ ),
+ `HSpacing(5.0),
+ // button label - keep it short
+ `HBox( `Right( `PushButton(`id("cancel"), `opt(`key_F9) ,_( "&Cancel" ) ) ),
+ // button label - keep it short
+ `Right( `PushButton(`id("ok"), `opt(`key_F10), _( "&Accept" ) ) )
+ )
+ )
+ )
+ )
+ );
+}
Added: branches/tmp/bubli/ncurses-pkg/src/you_layout.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/you_layout.ycp?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/src/you_layout.ycp (added)
+++ branches/tmp/bubli/ncurses-pkg/src/you_layout.ycp Fri Feb 8 13:59:32 2008
@@ -0,0 +1,95 @@
+/**
+ * File: you_layout.ycp
+ * Package:
+ * Authors: Gabriele Strattner
+ *
+ * Purpose:
+ *
+ * ncurses layout for YOU
+ *
+ * $Id: you_layout.ycp 37957 2007-05-14 08:36:10Z gs $
+ */
+{
+ textdomain "packages";
+
+ return `VBox( `VSpacing(0.3),
+ `HBox( `HSpacing(0.4),
+ // Labels and menu entries for the YaST Online Update
+ // label of the Online Update 'Filter' menu (keep it short)
+ `Left(`MenuButton( `opt(`key_F4), _( "&Filter" ),
+ // menu items - keep them short and use unique hotkeys from begin: to end:
+ // begin:
+ [ `item( `id("installablepatches"), _( "&Installable Patches" ) ),
+ `item( `id("instpatches"), _( "Installed &Patches" ) ),
+ `item( `id("allpatches"), _( "&All Patches" ) ),
+ `item( `id("newpatches"), _( "&New Patches" ) ),
+ `item( `id("recommended"), _( "&Recommended" )),
+ `item( `id("security"), _( "&Security" ) ),
+ `item( `id("optional"), _( "&Optional" ) ),
+ // end:
+ `item( `id("search"), _( "S&earch" ) )
+ ]
+ )),
+ // label of the Online Update 'Actions' menu (keep it short)
+ `Left(`MenuButton( `opt(`key_F5), _( "&Actions" ),
+ // menu items
+ [`item( `id("toggle"), _( "&Toggle [SPACE]" ) ),
+ `item( `id("select"), _( "&Select [+]" ) ),
+ `item( `id("delete"), _( "Dese&lect [-]" ) ),
+ `item( `id("update"), _( "&Update [>]" ) )
+ ]
+ )),
+ // label of the Online Update 'Information' menu (keep it short)
+ `Left(`MenuButton( `opt(`key_F6), _( "&Information" ),
+ // menu items
+ [`item( `id("patchdescr"), _( "&Long Description" ) ),
+ `item( `id("patchpackages"), _( "&Package List" ) ),
+ `item( `id("packagesversions"), _("&Versions") )
+ ]
+ )),
+ // label of the Online Update 'Etc' menu (keep it short)
+ `Left(`MenuButton( `opt(`key_F7), _( "&Etc." ),
+ [`item( `id("testcase"), _( "Generate Dependency Resolver &Test Case" ) )
+ ]
+ )),
+ `HStretch()
+ ),
+ `VSpacing(0.3),
+ `VWeight( 50, `HBox(`HSpacing(0.3),
+ `PkgSpecial( `id("packages"), `opt(`notify), "pkgTable" ),
+ `HSpacing(0.3)
+ )
+ ),
+ `HBox(
+ // label text - keep it short
+ `HWeight(1, `HBox(`Label( _( "Filter: " ) ),
+ `Label( `id("filter"), "........................." ),
+ `HSpacing( 0.1 )
+ )
+ ),
+ // label text - keep it short (use abbreviation if necessary)
+ // It's the total -download- size of the patches (not the installed size)
+ `HWeight(1, `HBox(`Label( _( "Total Download Size: " ) ),
+ `Label( `id("diskspace"), " " ),
+ `HSpacing( 0.1 )
+ )
+ )
+ ),
+ `VBox(`VWeight( 40, `ReplacePoint( `id(`replaceinfo),
+ `RichText( `id("description")," ")
+ )
+ ),
+ // button label
+ `VWeight( 5, `HBox(`Left(`PushButton(`id("youhelp"), `opt(`key_F1), _( "&Help" )) ),
+ `HSpacing(5.0),
+ // button label
+ `Right( `PushButton(`id("cancel"), `opt(`key_F9), _( "&Cancel" )) ),
+ // button label
+ `Right( `PushButton(`id("ok"), `opt(`key_F10), _( "&OK" )) )
+ )
+ )
+ )
+ );
+}
+
+
Added: branches/tmp/bubli/ncurses-pkg/yast2-ncurses-pkg.spec.in
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/yast2-ncurses-pkg.spec.in?rev=44281&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses-pkg/yast2-ncurses-pkg.spec.in (added)
+++ branches/tmp/bubli/ncurses-pkg/yast2-ncurses-pkg.spec.in Fri Feb 8 13:59:32 2008
@@ -0,0 +1,40 @@
+@HEADER-COMMENT@
+
+
+@HEADER@
+BuildRequires: doxygen dejagnu gcc-c++ yast2-core-devel yast2-devtools libzypp-devel
+BuildRequires: libxcrypt-devel blocxx-devel ncurses-devel
+
+Summary: -
+Provides: yast2_ui
+Provides: y2base:/var/lib/YaST2/servers/ncurses
+Provides: y2base:/usr/lib/YaST2/servers/ncurses
+Provides: y2base:/usr/lib/YaST2/plugin/libpy2ncurses.so.2
+Provides: yast2-ui-ncurses
+Obsoletes: yast2-ui-ncurses
+Provides: yast2-ui-ncurses-devel
+Obsoletes: yast2-ui-ncurses-devel
+Provides: y2curses
+Obsoletes: y2curses
+Requires: glibc-locale
+BuildRequires: yast2-core-devel >= 2.16.28
+Requires: yast2-core >= 2.16.28
+#adapted to libzypp 3.11 refactoring
+Requires: libzypp >= 3.11.8
+%description
+-
+
+@PREP@
+
+@BUILD@
+
+@INSTALL@
+rm $RPM_BUILD_ROOT/@plugindir@/libpy2ncurses_pkg.la
+
+@CLEAN@
+
+%files
+%defattr (-, root, root)
+@plugindir@/libpy2ncurses_pkg.so.*
+@plugindir@/libpy2ncurses_pkg.so
+%doc @docdir@
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org