Hello community,
here is the log from the commit of package yast2-libyui
checked in at Wed Jul 16 22:46:50 CEST 2008.
--------
--- yast2-libyui/yast2-libyui.changes 2008-06-18 18:55:52.000000000 +0200
+++ yast2-libyui/yast2-libyui.changes 2008-07-16 14:32:45.484707000 +0200
@@ -1,0 +2,18 @@
+Tue Jul 15 19:12:22 CEST 2008 - sh@suse.de
+
+- Implemented fate #303492: Multi selection for table widget
+- V 2.17.5
+
+-------------------------------------------------------------------
+Fri Jul 11 16:29:47 CEST 2008 - sh@suse.de
+
+- Fixed bnc #367023: Keyboard shortcuts for non-ASCII languages
+- V 2.17.4
+
+-------------------------------------------------------------------
+Tue Jul 8 18:57:10 CEST 2008 - sh@suse.de
+
+- Enable keyboard shortcuts for YDumbTab widgets (fate #304890)
+- V 2.17.3
+
+-------------------------------------------------------------------
Old:
----
yast2-libyui-2.17.2.tar.bz2
New:
----
yast2-libyui-2.17.5.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-libyui.spec ++++++
--- /var/tmp/diff_new_pack.wh8640/_old 2008-07-16 22:43:02.000000000 +0200
+++ /var/tmp/diff_new_pack.wh8640/_new 2008-07-16 22:43:02.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-libyui (Version 2.17.2)
+# spec file for package yast2-libyui (Version 2.17.5)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -12,12 +12,12 @@
Name: yast2-libyui
-Version: 2.17.2
+Version: 2.17.5
Release: 1
License: GPL v2 or later
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-libyui-2.17.2.tar.bz2
+Source0: yast2-libyui-2.17.5.tar.bz2
Prefix: /usr
Source1: yast2-libyui-rpmlintrc
BuildRequires: gcc-c++
@@ -70,7 +70,7 @@
Stefan Hundhammer
%prep
-%setup -n yast2-libyui-2.17.2
+%setup -n yast2-libyui-2.17.5
%build
%{prefix}/bin/y2tool y2autoconf
@@ -116,6 +116,15 @@
%{_datadir}/cmake/Modules/*
%doc %{prefix}/share/doc/packages/yast2-libyui
%changelog
+* Tue Jul 15 2008 sh@suse.de
+- Implemented fate #303492: Multi selection for table widget
+- V 2.17.5
+* Fri Jul 11 2008 sh@suse.de
+- Fixed bnc #367023: Keyboard shortcuts for non-ASCII languages
+- V 2.17.4
+* Tue Jul 08 2008 sh@suse.de
+- Enable keyboard shortcuts for YDumbTab widgets (fate #304890)
+- V 2.17.3
* Wed Jun 18 2008 sh@suse.de
- Introduced YEventFilter to improve support for higher-level
widgets that might send and need to handle internal events
++++++ yast2-libyui-2.17.2.tar.bz2 -> yast2-libyui-2.17.5.tar.bz2 ++++++
++++ 12980 lines of diff (skipped)
++++ retrying with extended exclude list
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-libyui-2.17.2/configure.in new/yast2-libyui-2.17.5/configure.in
--- old/yast2-libyui-2.17.2/configure.in 2008-06-18 18:54:43.000000000 +0200
+++ new/yast2-libyui-2.17.5/configure.in 2008-07-01 10:33:26.000000000 +0200
@@ -1,6 +1,6 @@
dnl configure.in for yast2-libyui
dnl
-dnl -- This file is generated by y2autoconf 2.16.8 - DO NOT EDIT! --
+dnl -- This file is generated by y2autoconf 2.16.7 - DO NOT EDIT! --
dnl (edit configure.in.in instead)
AC_INIT(yast2-libyui, 2.17.2, http://bugs.opensuse.org/, yast2-libyui)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-libyui-2.17.2/examples/Makefile.am new/yast2-libyui-2.17.5/examples/Makefile.am
--- old/yast2-libyui-2.17.2/examples/Makefile.am 2008-05-09 18:10:06.000000000 +0200
+++ new/yast2-libyui-2.17.5/examples/Makefile.am 2008-07-08 15:15:08.000000000 +0200
@@ -4,12 +4,13 @@
INCLUDES = -I$(top_srcdir)/src/
-noinst_PROGRAMS = \
- HelloWorld \
- ComboBox1 \
- ComboBox1-editable \
- SelectionBox1 \
- SelectionBox2
+noinst_PROGRAMS = \
+ HelloWorld \
+ ComboBox1 \
+ ComboBox1-editable \
+ SelectionBox1 \
+ SelectionBox2 \
+ SelectionBox3-many-items
HelloWorld_SOURCES = HelloWorld.cc
@@ -26,3 +27,7 @@
SelectionBox2_SOURCES = SelectionBox2.cc
SelectionBox2_LDADD = -L$(top_srcdir)/src -lyui
+
+SelectionBox3_many_items_SOURCES= SelectionBox3-many-items.cc
+SelectionBox3_many_items_LDADD = -L$(top_srcdir)/src -lyui
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-libyui-2.17.2/examples/SelectionBox3-many-items.cc new/yast2-libyui-2.17.5/examples/SelectionBox3-many-items.cc
--- old/yast2-libyui-2.17.2/examples/SelectionBox3-many-items.cc 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-libyui-2.17.5/examples/SelectionBox3-many-items.cc 2008-07-08 15:42:06.000000000 +0200
@@ -0,0 +1,211 @@
+// Comprehensive SelectionBox example:
+//
+// Replacing items, notify and immediate modes.
+//
+// Compile with:
+//
+// g++ -I/usr/include/YaST2/yui -lyui SelectionBox3-many-items.cc -o SelectionBox3-many-items
+
+#define YUILogComponent "example"
+#include "YUILog.h"
+
+#include "YUI.h"
+#include "YWidgetFactory.h"
+#include "YDialog.h"
+#include "YLayoutBox.h"
+#include "YSelectionBox.h"
+#include "YCheckBox.h"
+#include "YLabel.h"
+#include "YPushButton.h"
+#include "YAlignment.h"
+#include "YEvent.h"
+
+#define ITEM_COUNT 10000
+
+YItemCollection pizzaItems()
+{
+ YItemCollection items;
+ yuiMilestone() << "Creating item collection" << endl;
+
+ for ( int i=1; i<= ITEM_COUNT; i++ )
+ {
+ char name[80];
+ sprintf( name, "Pizza #%05d", i );
+ items.push_back( new YItem( name ) );
+ }
+
+ yuiMilestone() << "Item collection created" << endl;
+
+ return items;
+}
+
+
+YItemCollection pastaItems()
+{
+ YItemCollection items;
+ items.push_back( new YItem( "Spaghetti Napoli" ) );
+ items.push_back( new YItem( "Spaghetti Bolognese" ) );
+ items.push_back( new YItem( "Fusili Emiliana" ) );
+ items.push_back( new YItem( "Penne Calabrese" ) );
+ items.push_back( new YItem( "Penne Al Forno" ) );
+ items.push_back( new YItem( "Lasagne" ) );
+
+ return items;
+}
+
+
+
+int main( int argc, char **argv )
+{
+ YUILog::setLogFileName( "/tmp/libyui-examples.log" );
+ YUILog::enableDebugLogging();
+
+ //
+ // Create and open dialog
+ //
+
+ YDialog * dialog = YUI::widgetFactory()->createPopupDialog();
+ YLayoutBox * vbox = YUI::widgetFactory()->createVBox( dialog );
+
+ // Specify larger size for the SelectionBox: It can scroll, so its size
+ // depends on other widgets in the layout.
+ YAlignment * minSize = YUI::widgetFactory()->createMinSize( vbox, 40, 8 ); // minWidth, minHeight
+
+
+ // The SelectionBox. This is what this example all about.
+ // The other widgets are just here to allow some experimenting.
+
+ YSelectionBox * selBox = YUI::widgetFactory()->createSelectionBox( minSize, "&Menu" );
+ selBox->addItems( pastaItems() );
+
+
+ // Buttons to allow changing the SelectionBox items
+
+ YLayoutBox * buttonBox = YUI::widgetFactory()->createHBox( vbox );
+ YPushButton * pastaButton = YUI::widgetFactory()->createPushButton( buttonBox, "&Pasta" );
+ YPushButton * pizzaButton = YUI::widgetFactory()->createPushButton( buttonBox, "Pi&zza" );
+ YPushButton * clearButton = YUI::widgetFactory()->createPushButton( buttonBox, "C&lear" );
+ YPushButton * deselectButton = YUI::widgetFactory()->createPushButton( buttonBox, "&Deselect" );
+
+ YUI::widgetFactory()->createVSpacing( vbox, 0.5 );
+
+
+ // Check boxes to allow toogling "notify" and "immediate" for the SelectionBox
+
+ YAlignment * leftAlignment = YUI::widgetFactory()->createLeft( vbox );
+ YCheckBox * notifyCheckBox = YUI::widgetFactory()->createCheckBox( leftAlignment, "&Notify Mode" );
+ notifyCheckBox->setNotify();
+
+ leftAlignment = YUI::widgetFactory()->createLeft( vbox );
+ YCheckBox * immediateCheckBox = YUI::widgetFactory()->createCheckBox( leftAlignment, "&Immediate Mode" );
+ immediateCheckBox->setNotify();
+
+ YUI::widgetFactory()->createVSpacing( vbox, 0.3 );
+
+
+ // OutputField + button to allow monitoring the SelectionBox value
+ // (and when it changes, i.e. when events are sent)
+
+ YLayoutBox * hbox = YUI::widgetFactory()->createHBox( vbox );
+ YLabel * valueField = YUI::widgetFactory()->createOutputField( hbox, "???" );
+ valueField->setStretchable( YD_HORIZ, true ); // allow stretching over entire dialog width
+
+ YPushButton * valueButton = YUI::widgetFactory()->createPushButton( hbox, "&Value" );
+
+ YUI::widgetFactory()->createVSpacing( vbox, 0.7 );
+
+
+ // "Close" button
+
+ YAlignment * rightAlignment = YUI::widgetFactory()->createRight( vbox );
+ YPushButton * closeButton = YUI::widgetFactory()->createPushButton( rightAlignment, "&Close" );
+
+
+ //
+ // Event loop
+ //
+
+ while ( true )
+ {
+ YEvent * event = dialog->waitForEvent();
+
+ if ( event )
+ {
+ if ( event->eventType() == YEvent::CancelEvent ) // window manager "close window" button
+ break; // leave event loop
+
+ valueField->setValue( "???" );
+
+ if ( event->widget() == closeButton )
+ break; // leave event loop
+ else if ( event->widget() == pastaButton )
+ {
+ selBox->deleteAllItems();
+ selBox->addItems( pastaItems() );
+ }
+ else if ( event->widget() == pizzaButton )
+ {
+ selBox->deleteAllItems();
+ selBox->addItems( pizzaItems() );
+ yuiMilestone() << "Pizza items added" << endl;
+ }
+ else if ( event->widget() == clearButton )
+ {
+ selBox->deleteAllItems();
+ }
+ else if ( event->widget() == deselectButton )
+ {
+ selBox->deselectAllItems();
+ }
+ else if ( event->widget() == notifyCheckBox )
+ {
+ bool notify = notifyCheckBox->isChecked();
+
+ if ( ! notify )
+ {
+ // immediateMode implicitly includes notify, so set
+ // immediateMode off if the user wants to set notify off
+
+ selBox->setImmediateMode( false );
+ immediateCheckBox->setChecked( false );
+ }
+
+ selBox->setNotify( notify );
+ }
+ else if ( event->widget() == immediateCheckBox )
+ {
+ bool immediate = immediateCheckBox->isChecked();
+ selBox->setImmediateMode( immediate );
+
+ // immediateMode implicitly includes notify;
+ // reflect this in the notify check box
+
+ if ( immediate )
+ notifyCheckBox->setChecked( true );
+ }
+ else if ( event->widget() == selBox ||
+ event->widget() == valueButton )
+ {
+ yuiMilestone() << "Event widget: " << event->widget() << endl;
+
+ YItem * item = selBox->selectedItem();
+
+ if ( item )
+ valueField->setValue( item->label() );
+ else
+ valueField->setValue( "<none>" );
+ }
+ else
+ {
+ yuiMilestone() << "Unknown event" << endl;
+ }
+ }
+ }
+
+
+ //
+ // Clean up
+ //
+
+ dialog->destroy();
+}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-libyui-2.17.2/missing new/yast2-libyui-2.17.5/missing
--- old/yast2-libyui-2.17.2/missing 2008-06-18 18:54:59.000000000 +0200
+++ new/yast2-libyui-2.17.5/missing 2008-07-01 10:33:53.000000000 +0200
@@ -1,9 +1,9 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
-scriptversion=2005-06-08.21
+scriptversion=2006-05-10.23
-# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
# Free Software Foundation, Inc.
# Originally by Fran,cois Pinard , 1996.
@@ -33,6 +33,8 @@
fi
run=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
# In the cases where this matters, `missing' is being run in the
# srcdir already.
@@ -44,7 +46,7 @@
msg="missing on your system"
-case "$1" in
+case $1 in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
@@ -77,6 +79,7 @@
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
+ autom4te touch the output file, or create a stub one
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
@@ -106,7 +109,7 @@
# Now exit if we have it, but it failed. Also exit now if we
# don't have it and --version was passed (most likely to detect
# the program).
-case "$1" in
+case $1 in
lex|yacc)
# Not GNU programs, they don't have --version.
;;
@@ -135,7 +138,7 @@
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
-case "$1" in
+case $1 in
aclocal*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
@@ -164,7 +167,7 @@
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
- case "$f" in
+ case $f in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
@@ -192,8 +195,8 @@
You can get \`$1' as part of \`Autoconf' from any GNU
archive site."
- file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
- test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
@@ -214,25 +217,25 @@
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
- if [ $# -ne 1 ]; then
+ if test $# -ne 1; then
eval LASTARG="\${$#}"
- case "$LASTARG" in
+ case $LASTARG in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
- if [ -f "$SRCFILE" ]; then
+ if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
- if [ -f "$SRCFILE" ]; then
+ if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
- if [ ! -f y.tab.h ]; then
+ if test ! -f y.tab.h; then
echo >y.tab.h
fi
- if [ ! -f y.tab.c ]; then
+ if test ! -f y.tab.c; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
@@ -244,18 +247,18 @@
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
- if [ $# -ne 1 ]; then
+ if test $# -ne 1; then
eval LASTARG="\${$#}"
- case "$LASTARG" in
+ case $LASTARG in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
- if [ -f "$SRCFILE" ]; then
+ if test -f "$SRCFILE"; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
- if [ ! -f lex.yy.c ]; then
+ if test ! -f lex.yy.c; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
@@ -267,11 +270,9 @@
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
- file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
- if test -z "$file"; then
- file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
- fi
- if [ -f "$file" ]; then
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
@@ -289,11 +290,17 @@
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
# The file to touch is that specified with -o ...
- file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -z "$file"; then
# ... or it is the one specified with @setfilename ...
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
- file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
+ file=`sed -n '
+ /^@setfilename/{
+ s/.* \([^ ]*\) *$/\1/
+ p
+ q
+ }' $infile`
# ... or it is derived from the source name (dir/f.texi becomes f.info)
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
fi
@@ -317,13 +324,13 @@
fi
firstarg="$1"
if shift; then
- case "$firstarg" in
+ case $firstarg in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
tar "$firstarg" "$@" && exit 0
;;
esac
- case "$firstarg" in
+ case $firstarg in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
tar "$firstarg" "$@" && exit 0
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-libyui-2.17.2/src/YApplication.cc new/yast2-libyui-2.17.5/src/YApplication.cc
--- old/yast2-libyui-2.17.2/src/YApplication.cc 2008-06-05 16:18:43.000000000 +0200
+++ new/yast2-libyui-2.17.5/src/YApplication.cc 2008-07-08 18:45:19.000000000 +0200
@@ -28,6 +28,7 @@
#include "YUIException.h"
#include "YShortcut.h"
#include "YUI.h"
+#include "YItem.h"
using std::map;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-libyui-2.17.2/src/YDumbTab.cc new/yast2-libyui-2.17.5/src/YDumbTab.cc
--- old/yast2-libyui-2.17.2/src/YDumbTab.cc 2008-06-05 16:18:43.000000000 +0200
+++ new/yast2-libyui-2.17.5/src/YDumbTab.cc 2008-07-08 18:49:09.000000000 +0200
@@ -60,11 +60,6 @@
YDumbTab::addItem( YItem * item )
{
YSelectionWidget::addItem( item );
-
- // Remove any keyboard shortcut marker there might be
- // to avoid confusing the YShortcutManager
-
- item->setLabel( YShortcut::cleanShortcutString( item->label() ) );
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-libyui-2.17.2/src/YDumbTab.h new/yast2-libyui-2.17.5/src/YDumbTab.h
--- old/yast2-libyui-2.17.2/src/YDumbTab.h 2008-06-05 16:18:44.000000000 +0200
+++ new/yast2-libyui-2.17.5/src/YDumbTab.h 2008-07-08 18:46:03.000000000 +0200
@@ -62,6 +62,14 @@
virtual void addItem( YItem * item );
/**
+ * Notification that any shortcut of any item was changed by the shortcut
+ * conflict manager.
+ *
+ * Derived classes should reimplement this.
+ **/
+ virtual void shortcutChanged() {}
+
+ /**
* Set a property.
* Reimplemented from YWidget.
*
@@ -96,6 +104,10 @@
/**
* Get the string of this widget that holds the keyboard shortcut.
+ * Notice that since YDumbTab has one shortcut for each tab page (for each
+ * item), this is not meaningful for this widget class.
+ *
+ * Check YItemShortcut in YShortcut.{cc,h} for more details.
*
* Reimplemented from YSelectionWidget.
**/
@@ -103,10 +115,13 @@
/**
* Set the string of this widget that holds the keyboard shortcut.
+ * Since YDumbTab doesn't have a shortcut for the widget itself (only for
+ * the tab pages, i.e. the items), this will simply trigger a
+ * shortcutChanged() notification.
*
* Reimplemented from YSelectionWidget.
**/
- virtual void setShortcutString( const string & str ) {}
+ virtual void setShortcutString( const string & str ) { shortcutChanged(); }
/**
* Returns 'true' if this widget is stretchable in the specified dimension.
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-libyui-2.17.2/src/YSelectionWidget.h new/yast2-libyui-2.17.5/src/YSelectionWidget.h
--- old/yast2-libyui-2.17.2/src/YSelectionWidget.h 2008-06-05 16:18:43.000000000 +0200
+++ new/yast2-libyui-2.17.5/src/YSelectionWidget.h 2008-07-08 15:37:50.000000000 +0200
@@ -104,9 +104,6 @@
/**
* Add multiple items. For some UIs, this can be more efficient than
* calling addItem() multiple times.
- *
- * Derived classes can overwrite this function, but they should call this
- * base class function in the new implementation.
**/
virtual void addItems( const YItemCollection & itemCollection );
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-libyui-2.17.2/src/YShortcut.cc new/yast2-libyui-2.17.5/src/YShortcut.cc
--- old/yast2-libyui-2.17.2/src/YShortcut.cc 2008-06-05 16:18:43.000000000 +0200
+++ new/yast2-libyui-2.17.5/src/YShortcut.cc 2008-07-11 16:11:34.000000000 +0200
@@ -25,6 +25,7 @@
#include "YShortcut.h"
#include "YPushButton.h"
+#include "YDumbTab.h"
// Return the number of elements of an array of any type
@@ -172,9 +173,9 @@
int
YShortcut::distinctShortcutChars()
{
- if ( _distinctShortcutChars < 0 ) // chache this value - it's expensive!
+ if ( _distinctShortcutChars < 0 ) // cache this value - it's expensive!
{
- // Create and initiazlize "contained" array - what possible shortcut
+ // Create and initialize "contained" array - what possible shortcut
// characters are contained in that string?
bool contained[ sizeof(char) << 8 ];
@@ -211,6 +212,21 @@
}
+bool
+YShortcut::hasValidShortcutChar()
+{
+ string clean = cleanShortcutString();
+
+ for ( string::size_type pos=0; pos < clean.length(); pos++ )
+ {
+ if ( YShortcut::isValid( clean[ pos ] ) )
+ return true;
+ }
+
+ return false;
+}
+
+
string
YShortcut::getShortcutString()
{
@@ -282,3 +298,51 @@
return (char) 0;
}
+
+
+string
+YItemShortcut::getShortcutString()
+{
+ if ( ! _item )
+ return "";
+
+ return _item->label();
+}
+
+
+void
+YItemShortcut::setShortcut( char newShortcut )
+{
+ string str = cleanShortcutString();
+
+ if ( newShortcut != YShortcut::None )
+ {
+ char findme[] = { tolower( newShortcut ), toupper( newShortcut ), 0 };
+ string::size_type pos = str.find_first_of( findme );
+
+ if ( pos == string::npos )
+ {
+ yuiError() << "Can't find '<< " << newShortcut
+ << "' in item "
+ << " \"" << cleanShortcutString() << "\""
+ << endl;
+
+ return;
+ }
+
+ str.insert( pos,
+ string( 1, shortcutMarker() ) ); // equivalent to 'string( "& " )'
+ }
+
+ _item->setLabel( str );
+
+ // Notify the parent widget
+ widget()->setShortcutString( widget()->shortcutString() );
+
+ _shortcutStringCached = false;
+ _cleanShortcutStringCached = false;
+ _shortcut = newShortcut;
+
+}
+
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-libyui-2.17.2/src/YShortcut.h new/yast2-libyui-2.17.5/src/YShortcut.h
--- old/yast2-libyui-2.17.2/src/YShortcut.h 2008-06-05 16:18:43.000000000 +0200
+++ new/yast2-libyui-2.17.5/src/YShortcut.h 2008-07-11 16:10:46.000000000 +0200
@@ -25,6 +25,7 @@
#include <vector>
using std::vector;
+class YItem;
/**
@@ -73,9 +74,9 @@
bool isWizardButton() const { return _isWizardButton; }
/**
- * Returns the complete shortcut string ( which may or may not contain "& " ),
+ * Returns the complete shortcut string (which may or may not contain "&"),
* i.e. the value of the widget's shortcut property. For PushButtons, this
- * is the label on the button ( e.g., "& Details..." ), for other widgets
+ * is the label on the button ( e.g., "&Details..." ), for other widgets
* usually the caption above it.
*
* This value is chached, i.e. this isn't a too expensive operation.
@@ -84,19 +85,19 @@
/**
* Returns the shortcut string ( from the widget's shortcut property )
- * without any "& " markers.
+ * without any "&" markers.
**/
string cleanShortcutString();
/**
* Static version of the above for general use:
- * Returns the specified string without any "& " markers.
+ * Returns the specified string without any "&" markers.
**/
static string cleanShortcutString( string shortcutString );
/**
* The preferred shortcut character, i.e. the character that had been
- * preceded by "& " before checking / resolving conflicts began.
+ * preceded by "&" before checking / resolving conflicts began.
**/
char preferred();
@@ -110,7 +111,7 @@
/**
* Set (override) the shortcut character.
**/
- void setShortcut( char newShortcut );
+ virtual void setShortcut( char newShortcut );
/**
* Clear the shortcut: Override the shortcut character with nothing.
@@ -130,22 +131,29 @@
void setConflict( bool newConflictState = true ) { _conflict = newConflictState; }
/**
- * Obtain the number of distinct valid shortcut characters in the shortcut string,
- * i.e. how many different shortcuts that widget could get.
+ * Obtain the number of distinct valid shortcut characters in the shortcut
+ * string, i.e. how many different shortcuts that widget could get.
**/
int distinctShortcutChars();
+
+ /**
+ * Return true if this shortcut contains any character that would be valid
+ * as a shortcut character.
+ **/
+ bool hasValidShortcutChar();
/**
- * Static function: Returns the character used for marking keyboard shortcuts.
+ * Static function: Returns the character used for marking keyboard
+ * shortcuts.
**/
static char shortcutMarker() { return '&'; }
/**
- * Static function: Find the next occurrence of the shortcut marker ( '& ' ) in a
- * string, beginning at starting position start_pos.
+ * Static function: Find the next occurrence of the shortcut marker ('&')
+ * in a string, beginning at starting position start_pos.
*
- * Returns string::npos if not found or the position of the shortcut marker ( ! )
- * if found.
+ * Returns string::npos if not found or the position of the shortcut marker
+ * (not the shortcut character!) if found.
**/
static string::size_type findShortcutPos( const string & str, string::size_type start_pos = 0 );
@@ -170,7 +178,7 @@
static char normalized( char c );
/**
- * Obtain a widget's shortcut property - the string that contains "& " to
+ * Obtain a widget's shortcut property - the string that contains "&" to
* designate a shortcut.
**/
static string getShortcutString( const YWidget * widget );
@@ -180,9 +188,9 @@
/**
* Obtain the the shortcut property of this shortcut's widget - the string
- * that contains "& " to designate a shortcut.
+ * that contains "&" to designate a shortcut.
**/
- string getShortcutString();
+ virtual string getShortcutString();
// Data members
@@ -194,8 +202,8 @@
string _cleanShortcutString;
bool _cleanShortcutStringCached;
- int _preferred; // int to enable initializing with invalid char ( -1 )
- int _shortcut; // int to enable initializing with invalid char ( -1 )
+ int _preferred; // int to enable initializing with invalid char (-1)
+ int _shortcut; // int to enable initializing with invalid char (-1)
bool _conflict;
bool _isButton;
@@ -203,6 +211,54 @@
int _distinctShortcutChars;
};
+
+
+/**
+ * Special case for widgets that can have multiple shortcuts based on items
+ * (like YDumbTab)
+ **/
+class YItemShortcut: public YShortcut
+{
+public:
+ /**
+ * Constructor.
+ **/
+ YItemShortcut( YWidget * widget, YItem * item )
+ : YShortcut( widget )
+ , _item( item )
+ {}
+
+ /**
+ * Destructor.
+ **/
+ virtual ~YItemShortcut() {}
+
+ /**
+ * Return the associated item.
+ **/
+ YItem * item() const { return _item; }
+
+ /**
+ * Set (override) the shortcut character.
+ * In this subclass, it will change the internally stored item.
+ **/
+ virtual void setShortcut( char newShortcut );
+
+protected:
+
+ /**
+ * Obtain the the shortcut property of this shortcut's widget - the string
+ * that contains "&" to designate a shortcut.
+ **/
+ virtual string getShortcutString();
+
+
+private:
+
+ YItem * _item;
+};
+
+
typedef vector YShortcutList;
typedef YShortcutList::iterator YShortcutListIterator;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-libyui-2.17.2/src/YShortcutManager.cc new/yast2-libyui-2.17.5/src/YShortcutManager.cc
--- old/yast2-libyui-2.17.2/src/YShortcutManager.cc 2008-06-05 16:18:44.000000000 +0200
+++ new/yast2-libyui-2.17.5/src/YShortcutManager.cc 2008-07-11 16:23:31.000000000 +0200
@@ -22,8 +22,15 @@
#include "YShortcutManager.h"
#include "YDialog.h"
+#include "YDumbTab.h"
+// Threshold of widgets with valid shortcut characters below which no shortcut
+// check is performed at all. This might regularly occur for languages that
+// primarily use non-ASCII characters (Russian, Greek, Chinese, Japanese,
+// Korean).
+#define MIN_VALID_PERCENT 50
+
// Return the number of elements of an array of any type
#define DIM( ARRAY ) ( (int) ( sizeof( ARRAY)/( sizeof( ARRAY[0] ) ) ) )
@@ -51,6 +58,29 @@
clearShortcutList();
findShortcutWidgets( _dialog->childrenBegin(), _dialog->childrenEnd() );
+ int validCount = 0;
+
+ for ( unsigned i=0; i < _shortcutList.size(); i++ )
+ {
+ if ( _shortcutList[i]->hasValidShortcutChar() )
+ ++validCount;
+ }
+
+ int validPercent = _shortcutList.size() > 0 ?
+ ( 100 * validCount ) / _shortcutList.size() : 0;
+
+ if ( validPercent < MIN_VALID_PERCENT )
+ {
+ // No check at all if there are not enough widgets with valid shortcut
+ // characters ([A-Za-z0-9]). This might regularly occur for languages
+ // that primarily use non-ASCII characters (Russian, Greek, Chinese,
+ // Japanese, Korean).
+
+ yuiMilestone() << "Not enough widgets with valid shorctcut characters - no check" << endl;
+ yuiDebug() << "Found " << validCount << " widgets with valid shortcut characters" << endl;
+ return;
+ }
+
// Initialize wanted character counters
for ( int i=0; i < DIM( _wanted ); i++ )
@@ -346,8 +376,20 @@
for ( YWidgetListConstIterator it = begin; it != end; ++it )
{
YWidget * widget = *it;
-
- if ( ! widget->shortcutString().empty() )
+
+ YDumbTab * dumbTab = dynamic_cast (widget);
+
+ if ( dumbTab )
+ {
+ for ( YItemConstIterator it = dumbTab->itemsBegin();
+ it != dumbTab->itemsEnd();
+ ++it )
+ {
+ YItemShortcut * shortcut = new YItemShortcut( dumbTab, *it );
+ _shortcutList.push_back( shortcut );
+ }
+ }
+ else if ( ! widget->shortcutString().empty() )
{
YShortcut * shortcut = new YShortcut( *it );
_shortcutList.push_back( shortcut );
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-libyui-2.17.2/src/YTable.cc new/yast2-libyui-2.17.5/src/YTable.cc
--- old/yast2-libyui-2.17.2/src/YTable.cc 2008-06-05 16:18:43.000000000 +0200
+++ new/yast2-libyui-2.17.5/src/YTable.cc 2008-07-15 17:43:51.000000000 +0200
@@ -41,10 +41,10 @@
-YTable::YTable( YWidget * parent, YTableHeader * header )
+YTable::YTable( YWidget * parent, YTableHeader * header, bool multiSelection )
: YSelectionWidget( parent,
"", // label
- true ) // enforceSingleSelection
+ ! multiSelection ) // enforceSingleSelection
, priv( new YTablePrivate( header ) )
{
YUI_CHECK_PTR( header );
@@ -134,6 +134,12 @@
}
+bool
+YTable::hasMultiSelection() const
+{
+ return ! YSelectionWidget::enforceSingleSelection();
+}
+
const YPropertySet &
YTable::propertySet()
@@ -146,19 +152,23 @@
* @property itemID Value The currently selected item
* @property itemID CurrentItem The currently selected item
* @property itemList Items All items
+ * @property itemList SelectedItems All currently selected items
* @property string Cell One cell (one column of one item)
* @property integer Cell (ChangeWidget only) One cell as integer
* @property `icon(...) Cell Icon for one one cell
* @property string Item Alias for Cell
* @property string Item QueryWidget only: Return one complete item
* @property string IconPath Base path for icons
+ * @property bool MultiSelection Flag: User can select multiple items (read-only)
*/
propSet.add( YProperty( YUIProperty_Value, YOtherProperty ) );
propSet.add( YProperty( YUIProperty_CurrentItem, YOtherProperty ) );
+ propSet.add( YProperty( YUIProperty_SelectedItems, YOtherProperty ) );
propSet.add( YProperty( YUIProperty_Items, YOtherProperty ) );
propSet.add( YProperty( YUIProperty_Cell, YOtherProperty ) );
propSet.add( YProperty( YUIProperty_Item, YOtherProperty ) );
propSet.add( YProperty( YUIProperty_IconPath, YStringProperty ) );
+ propSet.add( YProperty( YUIProperty_MultiSelection, YBoolProperty, true ) ); // read-only
propSet.add( YWidget::propertySet() );
}
@@ -173,6 +183,7 @@
if ( propertyName == YUIProperty_Value ) return false; // Needs special handling
else if ( propertyName == YUIProperty_CurrentItem ) return false; // Needs special handling
+ else if ( propertyName == YUIProperty_SelectedItems ) return false; // Needs special handling
else if ( propertyName == YUIProperty_Items ) return false; // Needs special handling
else if ( propertyName == YUIProperty_Cell ) return false; // Needs special handling
else if ( propertyName == YUIProperty_Item ) return false; // Needs special handling
@@ -193,6 +204,7 @@
if ( propertyName == YUIProperty_Value ) return YPropertyValue( YOtherProperty );
else if ( propertyName == YUIProperty_CurrentItem ) return YPropertyValue( YOtherProperty );
+ else if ( propertyName == YUIProperty_SelectedItems ) return YPropertyValue( YOtherProperty );
else if ( propertyName == YUIProperty_Items ) return YPropertyValue( YOtherProperty );
else if ( propertyName == YUIProperty_Cell ) return YPropertyValue( YOtherProperty );
else if ( propertyName == YUIProperty_Item ) return YPropertyValue( YOtherProperty );
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-libyui-2.17.2/src/YTable.h new/yast2-libyui-2.17.5/src/YTable.h
--- old/yast2-libyui-2.17.2/src/YTable.h 2008-06-05 16:18:44.000000000 +0200
+++ new/yast2-libyui-2.17.5/src/YTable.h 2008-07-15 17:37:59.000000000 +0200
@@ -57,8 +57,12 @@
* headings, and column alignment. The widget assumes ownership of this
* object and will delete it when appropriate. The header cannot be changed
* after creating the widget.
+ *
+ * 'multiSelection' indicates whether or not the user can select multiple
+ * items at the same time (e.g., with shift-click or ctrl-click). This can
+ * only be set in the constructor.
**/
- YTable( YWidget * parent, YTableHeader * header );
+ YTable( YWidget * parent, YTableHeader * header, bool multiSelection );
public:
@@ -129,6 +133,12 @@
virtual void setKeepSorting( bool keepSorting );
/**
+ * Return 'true' if the user can select multiple items at the same time
+ * (e.g., with shift-click or ctrl-click).
+ **/
+ bool hasMultiSelection() const;
+
+ /**
* Notification that a cell (its text and/or its icon) was changed from the
* outside. Applications are required to call this whenever a table cell is
* changed after adding the corresponding table item (the row) to the table
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-libyui-2.17.2/src/YUISymbols.h new/yast2-libyui-2.17.5/src/YUISymbols.h
--- old/yast2-libyui-2.17.2/src/YUISymbols.h 2008-06-05 16:18:43.000000000 +0200
+++ new/yast2-libyui-2.17.5/src/YUISymbols.h 2008-07-15 17:41:46.000000000 +0200
@@ -168,6 +168,7 @@
#define YUIProperty_MaxLines "MaxLines"
#define YUIProperty_MaxValue "MaxValue"
#define YUIProperty_MinValue "MinValue"
+#define YUIProperty_MultiSelection "MultiSelection"
#define YUIProperty_Notify "Notify"
#define YUIProperty_OpenItems "OpenItems"
#define YUIProperty_SelectedItems "SelectedItems"
@@ -205,6 +206,7 @@
#define YUIOpt_keepSorting "keepSorting"
#define YUIOpt_keyEvents "keyEvents"
#define YUIOpt_mainDialog "mainDialog"
+#define YUIOpt_multiSelection "multiSelection"
#define YUIOpt_noAutoEnable "noAutoEnable"
#define YUIOpt_notify "notify"
#define YUIOpt_outputField "outputField"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-libyui-2.17.2/src/YWidgetFactory.h new/yast2-libyui-2.17.5/src/YWidgetFactory.h
--- old/yast2-libyui-2.17.2/src/YWidgetFactory.h 2008-06-05 16:18:43.000000000 +0200
+++ new/yast2-libyui-2.17.5/src/YWidgetFactory.h 2008-07-16 12:16:26.000000000 +0200
@@ -100,7 +100,7 @@
virtual YComboBox * createComboBox ( YWidget * parent, const string & label, bool editable = false ) = 0;
virtual YSelectionBox * createSelectionBox ( YWidget * parent, const string & label ) = 0;
virtual YTree * createTree ( YWidget * parent, const string & label ) = 0;
- virtual YTable * createTable ( YWidget * parent, YTableHeader * header ) = 0;
+ virtual YTable * createTable ( YWidget * parent, YTableHeader * header, bool multiSelection = false ) = 0;
virtual YProgressBar * createProgressBar ( YWidget * parent, const string & label, int maxValue = 100 ) = 0;
virtual YRichText * createRichText ( YWidget * parent, const string & text = string(), bool plainTextMode = false ) = 0;
virtual YBusyIndicator * createBusyIndicator ( YWidget * parent, const string & label, int timeout = 1000 ) = 0;
@@ -185,7 +185,7 @@
YWidgetFactory();
/**
- * Destructory.
+ * Destructor.
**/
virtual ~YWidgetFactory();
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-libyui-2.17.2/VERSION new/yast2-libyui-2.17.5/VERSION
--- old/yast2-libyui-2.17.2/VERSION 2008-06-18 18:49:36.000000000 +0200
+++ new/yast2-libyui-2.17.5/VERSION 2008-07-15 17:33:12.000000000 +0200
@@ -1 +1 @@
-2.17.2
+2.17.5
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org