Mailinglist Archive: opensuse-commit (2125 mails)
| < Previous | Next > |
commit yast2-libyui
- From: root@xxxxxxxxxxxxxxx (h_root)
- Date: Fri, 04 Apr 2008 01:13:42 +0200
- Message-id: <20080403231342.C5A1B678168@xxxxxxxxxxxxxxx>
Hello community,
here is the log from the commit of package yast2-libyui
checked in at Fri Apr 4 01:13:42 CEST 2008.
--------
--- yast2-libyui/yast2-libyui.changes 2008-03-07 13:05:02.000000000 +0100
+++ /mounts/work_src_done/STABLE/yast2-libyui/yast2-libyui.changes
2008-04-03 18:08:12.749576000 +0200
@@ -1,0 +2,20 @@
+Thu Apr 3 15:03:35 CEST 2008 - sh@xxxxxxx
+
+- Added YPushButton::setHelpButton() and isHelpButton()
+- Automatically show topmost YWidget::helpText() when a help button
+ is activated
+- V 2.16.41
+
+-------------------------------------------------------------------
+Tue Apr 1 17:49:15 CEST 2008 - sh@xxxxxxx
+
+- Added "HelpText" property to YWidget for easier support of
+ YCP wizard layouts without permanent help panel (fate #303291)
+
+-------------------------------------------------------------------
+Thu Mar 20 19:17:19 CET 2008 - sh@xxxxxxx
+
+- Added standard file logger (when used independently of YaST2)
+- V 2.16.40
+
+-------------------------------------------------------------------
Old:
----
yast2-libyui-2.16.39.tar.bz2
New:
----
yast2-libyui-2.16.41.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-libyui.spec ++++++
--- /var/tmp/diff_new_pack.Sa3839/_old 2008-04-04 01:12:28.000000000 +0200
+++ /var/tmp/diff_new_pack.Sa3839/_new 2008-04-04 01:12:28.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-libyui (Version 2.16.39)
+# spec file for package yast2-libyui (Version 2.16.41)
#
# 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.16.39
+Version: 2.16.41
Release: 1
License: GPL v2 or later
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-libyui-2.16.39.tar.bz2
+Source0: yast2-libyui-2.16.41.tar.bz2
Prefix: /usr
Source1: yast2-libyui-rpmlintrc
BuildRequires: gcc-c++
@@ -47,6 +47,7 @@
Stefan Hundhammer <sh@xxxxxxx>
%package devel
+License: GPL v2 or later
Requires: yast2-libyui = %version
Group: System/YaST
Summary: YaST2 - Development Package for User Interface Engine
@@ -69,7 +70,7 @@
Stefan Hundhammer <sh@xxxxxxx>
%prep
-%setup -n yast2-libyui-2.16.39
+%setup -n yast2-libyui-2.16.41
%build
%{prefix}/bin/y2tool y2autoconf
@@ -115,6 +116,17 @@
%{_datadir}/cmake/Modules/*
%doc %{prefix}/share/doc/packages/yast2-libyui
%changelog
+* Thu Apr 03 2008 sh@xxxxxxx
+- Added YPushButton::setHelpButton() and isHelpButton()
+- Automatically show topmost YWidget::helpText() when a help button
+ is activated
+- V 2.16.41
+* Tue Apr 01 2008 sh@xxxxxxx
+- Added "HelpText" property to YWidget for easier support of
+ YCP wizard layouts without permanent help panel (fate #303291)
+* Thu Mar 20 2008 sh@xxxxxxx
+- Added standard file logger (when used independently of YaST2)
+- V 2.16.40
* Wed Mar 05 2008 sh@xxxxxxx
- Fixed bnc #365999: Shift-F7 affects only UI logging
- V 2.16.39
++++++ yast2-libyui-2.16.39.tar.bz2 -> yast2-libyui-2.16.41.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn
--exclude=.svnignore old/yast2-libyui-2.16.39/configure
new/yast2-libyui-2.16.41/configure
--- old/yast2-libyui-2.16.39/configure 2008-02-26 18:19:41.000000000 +0100
+++ new/yast2-libyui-2.16.41/configure 2008-03-12 19:42:28.000000000 +0100
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.60 for yast2-libyui 2.16.38.
+# Generated by GNU Autoconf 2.60 for yast2-libyui 2.16.39.
#
# Report bugs to <http://bugs.opensuse.org/>.
#
@@ -713,8 +713,8 @@
# Identity of this package.
PACKAGE_NAME='yast2-libyui'
PACKAGE_TARNAME='yast2-libyui'
-PACKAGE_VERSION='2.16.38'
-PACKAGE_STRING='yast2-libyui 2.16.38'
+PACKAGE_VERSION='2.16.39'
+PACKAGE_STRING='yast2-libyui 2.16.39'
PACKAGE_BUGREPORT='http://bugs.opensuse.org/'
ac_unique_file="RPMNAME"
@@ -1423,7 +1423,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures yast2-libyui 2.16.38 to adapt to many kinds of systems.
+\`configure' configures yast2-libyui 2.16.39 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1494,7 +1494,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of yast2-libyui 2.16.38:";;
+ short | recursive ) echo "Configuration of yast2-libyui 2.16.39:";;
esac
cat <<\_ACEOF
@@ -1600,7 +1600,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-yast2-libyui configure 2.16.38
+yast2-libyui configure 2.16.39
generated by GNU Autoconf 2.60
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1614,7 +1614,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by yast2-libyui $as_me 2.16.38, which was
+It was created by yast2-libyui $as_me 2.16.39, which was
generated by GNU Autoconf 2.60. Invocation command line was
$ $0 $@
@@ -2415,7 +2415,7 @@
# Define the identity of the package.
PACKAGE='yast2-libyui'
- VERSION='2.16.38'
+ VERSION='2.16.39'
cat >>confdefs.h <<_ACEOF
@@ -2643,7 +2643,7 @@
-VERSION="2.16.38"
+VERSION="2.16.39"
RPMNAME="yast2-libyui"
MAINTAINER="Stefan Hundhammer <sh@xxxxxxx>"
@@ -22702,7 +22702,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by yast2-libyui $as_me 2.16.38, which was
+This file was extended by yast2-libyui $as_me 2.16.39, which was
generated by GNU Autoconf 2.60. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -22755,7 +22755,7 @@
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-yast2-libyui config.status 2.16.38
+yast2-libyui config.status 2.16.39
configured by $0, generated by GNU Autoconf 2.60,
with options \\"`echo "$ac_configure_args" | sed 's/^ //;
s/[\\""\`\$]/\\\\&/g'`\\"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn
--exclude=.svnignore old/yast2-libyui-2.16.39/configure.in
new/yast2-libyui-2.16.41/configure.in
--- old/yast2-libyui-2.16.39/configure.in 2008-02-26 18:19:29.000000000
+0100
+++ new/yast2-libyui-2.16.41/configure.in 2008-03-12 19:42:15.000000000
+0100
@@ -1,9 +1,9 @@
dnl configure.in for yast2-libyui
dnl
-dnl -- This file is generated by y2autoconf 2.16.6 - DO NOT EDIT! --
+dnl -- This file is generated by y2autoconf 2.16.8 - DO NOT EDIT! --
dnl (edit configure.in.in instead)
-AC_INIT(yast2-libyui, 2.16.38, http://bugs.opensuse.org/, yast2-libyui)
+AC_INIT(yast2-libyui, 2.16.39, http://bugs.opensuse.org/, yast2-libyui)
dnl Check for presence of file 'RPMNAME'
AC_CONFIG_SRCDIR([RPMNAME])
@@ -18,7 +18,7 @@
AM_INIT_AUTOMAKE(tar-ustar -Wno-portability)
dnl Important YaST2 variables
-VERSION="2.16.38"
+VERSION="2.16.39"
RPMNAME="yast2-libyui"
MAINTAINER="Stefan Hundhammer <sh@xxxxxxx>"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn
--exclude=.svnignore old/yast2-libyui-2.16.39/examples/Makefile.am
new/yast2-libyui-2.16.41/examples/Makefile.am
--- old/yast2-libyui-2.16.39/examples/Makefile.am 2008-02-21
16:12:40.000000000 +0100
+++ new/yast2-libyui-2.16.41/examples/Makefile.am 2008-03-12
19:05:36.000000000 +0100
@@ -4,7 +4,17 @@
INCLUDES = -I$(top_srcdir)/src/
-noinst_PROGRAMS = HelloWorld
+noinst_PROGRAMS = \
+ HelloWorld \
+ SelectionBox1 \
+ SelectionBox2
+
HelloWorld_SOURCES = HelloWorld.cc
HelloWorld_LDADD = -L$(top_srcdir)/src -lyui
+
+SelectionBox1_SOURCES = SelectionBox1.cc
+SelectionBox1_LDADD = -L$(top_srcdir)/src -lyui
+
+SelectionBox2_SOURCES = SelectionBox2.cc
+SelectionBox2_LDADD = -L$(top_srcdir)/src -lyui
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn
--exclude=.svnignore old/yast2-libyui-2.16.39/examples/Makefile.in
new/yast2-libyui-2.16.41/examples/Makefile.in
--- old/yast2-libyui-2.16.39/examples/Makefile.in 2008-02-26
18:19:44.000000000 +0100
+++ new/yast2-libyui-2.16.41/examples/Makefile.in 2008-03-12
19:42:33.000000000 +0100
@@ -41,7 +41,8 @@
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
-noinst_PROGRAMS = HelloWorld$(EXEEXT)
+noinst_PROGRAMS = HelloWorld$(EXEEXT) SelectionBox1$(EXEEXT) \
+ SelectionBox2$(EXEEXT)
subdir = examples
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -55,6 +56,12 @@
am_HelloWorld_OBJECTS = HelloWorld.$(OBJEXT)
HelloWorld_OBJECTS = $(am_HelloWorld_OBJECTS)
HelloWorld_DEPENDENCIES =
+am_SelectionBox1_OBJECTS = SelectionBox1.$(OBJEXT)
+SelectionBox1_OBJECTS = $(am_SelectionBox1_OBJECTS)
+SelectionBox1_DEPENDENCIES =
+am_SelectionBox2_OBJECTS = SelectionBox2.$(OBJEXT)
+SelectionBox2_OBJECTS = $(am_SelectionBox2_OBJECTS)
+SelectionBox2_DEPENDENCIES =
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
@@ -66,8 +73,10 @@
CXXLD = $(CXX)
CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-SOURCES = $(HelloWorld_SOURCES)
-DIST_SOURCES = $(HelloWorld_SOURCES)
+SOURCES = $(HelloWorld_SOURCES) $(SelectionBox1_SOURCES) \
+ $(SelectionBox2_SOURCES)
+DIST_SOURCES = $(HelloWorld_SOURCES) $(SelectionBox1_SOURCES) \
+ $(SelectionBox2_SOURCES)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -223,6 +232,10 @@
INCLUDES = -I$(top_srcdir)/src/
HelloWorld_SOURCES = HelloWorld.cc
HelloWorld_LDADD = -L$(top_srcdir)/src -lyui
+SelectionBox1_SOURCES = SelectionBox1.cc
+SelectionBox1_LDADD = -L$(top_srcdir)/src -lyui
+SelectionBox2_SOURCES = SelectionBox2.cc
+SelectionBox2_LDADD = -L$(top_srcdir)/src -lyui
all: all-am
.SUFFIXES:
@@ -266,6 +279,12 @@
HelloWorld$(EXEEXT): $(HelloWorld_OBJECTS) $(HelloWorld_DEPENDENCIES)
@rm -f HelloWorld$(EXEEXT)
$(CXXLINK) $(HelloWorld_LDFLAGS) $(HelloWorld_OBJECTS)
$(HelloWorld_LDADD) $(LIBS)
+SelectionBox1$(EXEEXT): $(SelectionBox1_OBJECTS) $(SelectionBox1_DEPENDENCIES)
+ @rm -f SelectionBox1$(EXEEXT)
+ $(CXXLINK) $(SelectionBox1_LDFLAGS) $(SelectionBox1_OBJECTS)
$(SelectionBox1_LDADD) $(LIBS)
+SelectionBox2$(EXEEXT): $(SelectionBox2_OBJECTS) $(SelectionBox2_DEPENDENCIES)
+ @rm -f SelectionBox2$(EXEEXT)
+ $(CXXLINK) $(SelectionBox2_LDFLAGS) $(SelectionBox2_OBJECTS)
$(SelectionBox2_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -274,6 +293,8 @@
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/HelloWorld.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SelectionBox1.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SelectionBox2.Po@am__quote@
.cc.o:
@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo"
-c -o $@ $<; \
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn
--exclude=.svnignore old/yast2-libyui-2.16.39/examples/SelectionBox1.cc
new/yast2-libyui-2.16.41/examples/SelectionBox1.cc
--- old/yast2-libyui-2.16.39/examples/SelectionBox1.cc 1970-01-01
01:00:00.000000000 +0100
+++ new/yast2-libyui-2.16.41/examples/SelectionBox1.cc 2008-03-12
19:08:35.000000000 +0100
@@ -0,0 +1,105 @@
+// Simple SelectionBox example.
+//
+// Compile with:
+//
+// g++ -I/usr/include/YaST2/yui -lyui SelectionBox1.cc -o SelectionBox1
+
+#define YUILogComponent "example"
+#include "YUILog.h"
+
+#include "YUI.h"
+#include "YWidgetFactory.h"
+#include "YDialog.h"
+#include "YLayoutBox.h"
+#include "YSelectionBox.h"
+#include "YLabel.h"
+#include "YPushButton.h"
+#include "YAlignment.h"
+#include "YEvent.h"
+
+
+
+int main( int argc, char **argv )
+{
+ //
+ // Create and open dialog
+ //
+
+ YDialog * dialog = YUI::widgetFactory()->createPopupDialog();
+ YLayoutBox * vbox = YUI::widgetFactory()->createVBox( dialog );
+
+ YSelectionBox * selBox = YUI::widgetFactory()->createSelectionBox( vbox,
"&Menu" );
+
+ YItemCollection items;
+ items.push_back( new YItem( "Pizza Margherita" ) );
+ items.push_back( new YItem( "Pizza Capricciosa" ) );
+ items.push_back( new YItem( "Pizza Funghi" ) );
+ items.push_back( new YItem( "Pizza Prosciutto" ) );
+ items.push_back( new YItem( "Pizza Quattro Stagioni" ) );
+ items.push_back( new YItem( "Calzone" ) );
+ selBox->addItems( items ); // This is more efficient than repeatedly
calling selBox->addItem()
+
+
+ YLayoutBox * hbox = YUI::widgetFactory()->createHBox( vbox );
+ YLabel * valueField = YUI::widgetFactory()->createOutputField( hbox,
"<SelectionBox value unknown>" );
+ valueField->setStretchable( YD_HORIZ, true ); // allow stretching over
entire dialog width
+
+ YPushButton * valueButton = YUI::widgetFactory()->createPushButton( hbox,
"&Value" );
+
+ YUI::widgetFactory()->createVSpacing( vbox, 0.3 );
+
+ 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
+
+ YWidgetEvent * widgetEvent = dynamic_cast<YWidgetEvent *> (event);
+
+ if ( widgetEvent )
+ {
+ valueField->setValue( "???" );
+
+ if ( widgetEvent->widget() == closeButton )
+ break; // leave event loop
+
+ if ( widgetEvent->widget() == valueButton ||
+ widgetEvent->widget() == selBox ) // selBox will only send
events with setNotify()
+ {
+ YItem * item = selBox->selectedItem();
+
+ if ( item )
+ valueField->setValue( item->label() );
+ else
+ valueField->setValue( "<none>" );
+ }
+ }
+
+
+ // YDialog::waitForEvent() allocates a new YEvent and transfers
+ // ownership of the event to the caller, so the caller has to make
+ // sure the memory for the event is deallocated after use.
+ // Otherwise there will be a memory leak.
+
+ delete event;
+ }
+ }
+
+
+ //
+ // Clean up
+ //
+
+ dialog->destroy();
+}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn
--exclude=.svnignore old/yast2-libyui-2.16.39/examples/SelectionBox2.cc
new/yast2-libyui-2.16.41/examples/SelectionBox2.cc
--- old/yast2-libyui-2.16.39/examples/SelectionBox2.cc 1970-01-01
01:00:00.000000000 +0100
+++ new/yast2-libyui-2.16.41/examples/SelectionBox2.cc 2008-03-20
20:14:44.000000000 +0100
@@ -0,0 +1,207 @@
+// Comprehensive SelectionBox example:
+//
+// Replacing items, notify and immediate modes.
+//
+// Compile with:
+//
+// g++ -I/usr/include/YaST2/yui -lyui SelectionBox2.cc -o SelectionBox2
+
+#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"
+
+
+YItemCollection pizzaItems()
+{
+ YItemCollection items;
+ items.push_back( new YItem( "Pizza Margherita" ) );
+ items.push_back( new YItem( "Pizza Capricciosa" ) );
+ items.push_back( new YItem( "Pizza Funghi" ) );
+ items.push_back( new YItem( "Pizza Prosciutto" ) );
+ items.push_back( new YItem( "Pizza Quattro Stagioni" ) );
+ items.push_back( new YItem( "Calzone" ) );
+
+ 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( pizzaItems() );
+
+
+ // 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() );
+ }
+ 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 )
+ {
+ YItem * item = selBox->selectedItem();
+
+ if ( item )
+ valueField->setValue( item->label() );
+ else
+ valueField->setValue( "<none>" );
+ }
+ }
+
+
+ // YDialog::waitForEvent() allocates a new YEvent and transfers
+ // ownership of the event to the caller, so the caller has to make
+ // sure the memory for the event is deallocated after use.
+ // Otherwise there will be a memory leak.
+
+ delete event;
+ }
+
+
+ //
+ // Clean up
+ //
+
+ dialog->destroy();
+}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn
--exclude=.svnignore old/yast2-libyui-2.16.39/src/YCheckBoxFrame.h
new/yast2-libyui-2.16.41/src/YCheckBoxFrame.h
--- old/yast2-libyui-2.16.39/src/YCheckBoxFrame.h 2008-02-21
13:58:30.000000000 +0100
+++ new/yast2-libyui-2.16.41/src/YCheckBoxFrame.h 2008-03-12
18:18:06.000000000 +0100
@@ -135,7 +135,7 @@
* The name of the widget property that will return user input.
* Inherited from YWidget.
**/
- const char *userInputProperty() { return YUIProperty_Value; }
+ const char * userInputProperty() { return YUIProperty_Value; }
/**
* Set a property.
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn
--exclude=.svnignore old/yast2-libyui-2.16.39/src/YCheckBox.h
new/yast2-libyui-2.16.41/src/YCheckBox.h
--- old/yast2-libyui-2.16.39/src/YCheckBox.h 2008-02-21 13:58:30.000000000
+0100
+++ new/yast2-libyui-2.16.41/src/YCheckBox.h 2008-03-12 18:55:45.000000000
+0100
@@ -95,7 +95,7 @@
/**
* Simplified access to setValue(): Check of uncheck the CheckBox.
**/
- void setChecked( bool checked )
+ void setChecked( bool checked = true )
{ setValue( checked ? YCheckBox_on : YCheckBox_off ); }
/**
@@ -186,7 +186,7 @@
* The name of the widget property that will return user input.
* Inherited from YWidget.
**/
- const char *userInputProperty() { return YUIProperty_Value; }
+ const char * userInputProperty() { return YUIProperty_Value; }
private:
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn
--exclude=.svnignore old/yast2-libyui-2.16.39/src/YComboBox.h
new/yast2-libyui-2.16.41/src/YComboBox.h
--- old/yast2-libyui-2.16.39/src/YComboBox.h 2008-02-21 13:58:30.000000000
+0100
+++ new/yast2-libyui-2.16.41/src/YComboBox.h 2008-03-12 18:18:41.000000000
+0100
@@ -202,7 +202,7 @@
* The name of the widget property that will return user input.
* Inherited from YWidget.
**/
- const char *userInputProperty() { return YUIProperty_Value; }
+ const char * userInputProperty() { return YUIProperty_Value; }
protected:
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn
--exclude=.svnignore old/yast2-libyui-2.16.39/src/YDialog.cc
new/yast2-libyui-2.16.41/src/YDialog.cc
--- old/yast2-libyui-2.16.39/src/YDialog.cc 2008-02-21 13:58:30.000000000
+0100
+++ new/yast2-libyui-2.16.41/src/YDialog.cc 2008-04-03 16:00:31.000000000
+0200
@@ -23,6 +23,12 @@
#include "YDialog.h"
#include "YShortcutManager.h"
#include "YPushButton.h"
+
+#include "YUI.h"
+#include "YWidgetFactory.h"
+#include "YLayoutBox.h"
+#include "YRichText.h"
+#include "YAlignment.h"
#include "YUIException.h"
using std::string;
@@ -256,6 +262,47 @@
// If there was no event or if filterInvalidEvents() discarded
// an invalid event, go back and get the next one.
+
+ if ( event->widget() )
+ {
+ YPushButton * button = dynamic_cast<YPushButton *> (
event->widget() );
+
+ if ( button && button->isHelpButton() )
+ {
+ string helpText;
+ YWidget * widget = button;
+
+ while ( widget )
+ {
+ if ( ! widget->helpText().empty() )
+ {
+ yuiDebug() << "Found help text for " << widget << endl;
+ helpText = widget->helpText();
+ }
+
+ widget = widget->parent();
+ }
+
+ if ( ! helpText.empty() )
+ {
+ yuiMilestone() << "Showing help text" << endl;
+ showText( helpText, true );
+
+ // Don't return the event from this help button -
+ // get back into event loop
+ delete event;
+ event = 0;
+
+ yuiMilestone() << "Help dialog closed" << endl;
+ }
+ else // No help text
+ {
+ // Return the event from this help button
+ yuiWarning() << "No help text in " << this << endl;
+ }
+ }
+ }
+
} while ( ! event );
return event;
@@ -419,3 +466,28 @@
}
+void
+YDialog::showText( const string & text, bool useRichText )
+{
+ try
+ {
+ YDialog * dialog = YUI::widgetFactory()->createPopupDialog();
+ YAlignment * minSize = YUI::widgetFactory()->createMinSize( dialog,
45, 15 );
+ YLayoutBox * vbox = YUI::widgetFactory()->createVBox( minSize );
+ YUI::widgetFactory()->createRichText( vbox, text, ! useRichText );
+ YPushButton * okButton = YUI::widgetFactory()->createPushButton( vbox,
"&OK" );
+ okButton->setDefaultButton();
+
+ YEvent * event = dialog->waitForEvent();
+
+ if ( event )
+ delete event;
+ dialog->destroy();
+ }
+ catch ( YUIException exception )
+ {
+ // Don't let the application die just because help couldn't be
displayed.
+
+ YUI_CAUGHT( exception );
+ }
+}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn
--exclude=.svnignore old/yast2-libyui-2.16.39/src/YDialog.h
new/yast2-libyui-2.16.41/src/YDialog.h
--- old/yast2-libyui-2.16.39/src/YDialog.h 2008-02-21 13:58:30.000000000
+0100
+++ new/yast2-libyui-2.16.41/src/YDialog.h 2008-04-03 14:53:45.000000000
+0200
@@ -256,6 +256,13 @@
**/
virtual void activate() = 0;
+ /**
+ * Show the specified text in a pop-up dialog with a local event loop.
+ * This is useful for help texts.
+ * 'richText' indicates if YRichText formatting should be applied.
+ **/
+ static void showText( const string & text, bool richText = false );
+
protected:
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn
--exclude=.svnignore old/yast2-libyui-2.16.39/src/YEvent.h
new/yast2-libyui-2.16.41/src/YEvent.h
--- old/yast2-libyui-2.16.39/src/YEvent.h 2008-02-21 13:58:30.000000000
+0100
+++ new/yast2-libyui-2.16.41/src/YEvent.h 2008-03-20 20:13:23.000000000
+0100
@@ -80,6 +80,23 @@
unsigned long serial() const { return _serial; }
/**
+ * Returns the widget that caused this event or 0 if there is none.
+ *
+ * This default implementation always returns 0.
+ * Subclasses that actually return widgets should overwrite this method.
+ **/
+ virtual YWidget * widget() const { return 0; }
+
+ /**
+ * Return the YItem that corresponds to this event or 0 if there is none.
+ *
+ * This default implementation always returns 0.
+ * Subclasses that actually return items should overwrite this method.
+ **/
+ virtual YItem * item() const { return 0; }
+
+
+ /**
* Returns the character representation of an event type.
**/
static const char * toString( EventType eventType );
@@ -113,10 +130,10 @@
EventType eventType = WidgetEvent );
/**
- * Returns the widget that caused this event. This might as well be 0 if
- * this is not a widget event.
+ * Returns the widget that caused this event.
+ * Reimplemented from YEvent.
**/
- YWidget * widget() const { return _widget; }
+ virtual YWidget * widget() const { return _widget; }
/**
* Returns the reason for this event. This very much like an event
sub-type.
@@ -183,8 +200,10 @@
/**
* Return the YItem that corresponds to this event or 0 if the event was
* constructed with a string ID.
+ *
+ * Reimplemented from YEvent.
**/
- YItem * item() const { return _item; }
+ virtual YItem * item() const { return _item; }
/**
* Return the string ID of this event. This will be an empty string if the
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn
--exclude=.svnignore old/yast2-libyui-2.16.39/src/YMultiLineEdit.h
new/yast2-libyui-2.16.41/src/YMultiLineEdit.h
--- old/yast2-libyui-2.16.39/src/YMultiLineEdit.h 2008-02-21
13:58:30.000000000 +0100
+++ new/yast2-libyui-2.16.41/src/YMultiLineEdit.h 2008-03-12
18:18:43.000000000 +0100
@@ -164,7 +164,7 @@
* The name of the widget property that will return user input.
* Inherited from YWidget.
**/
- const char *userInputProperty() { return YUIProperty_Value; }
+ const char * userInputProperty() { return YUIProperty_Value; }
private:
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn
--exclude=.svnignore old/yast2-libyui-2.16.39/src/YMultiSelectionBox.h
new/yast2-libyui-2.16.41/src/YMultiSelectionBox.h
--- old/yast2-libyui-2.16.39/src/YMultiSelectionBox.h 2008-02-21
13:58:30.000000000 +0100
+++ new/yast2-libyui-2.16.41/src/YMultiSelectionBox.h 2008-03-12
18:18:45.000000000 +0100
@@ -91,7 +91,7 @@
* The name of the widget property that will return user input.
* Inherited from YWidget.
**/
- const char *userInputProperty() { return YUIProperty_SelectedItems; }
+ const char * userInputProperty() { return YUIProperty_SelectedItems; }
/**
* Return the the item that currently has the keyboard focus
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn
--exclude=.svnignore old/yast2-libyui-2.16.39/src/YPartitionSplitter.h
new/yast2-libyui-2.16.41/src/YPartitionSplitter.h
--- old/yast2-libyui-2.16.39/src/YPartitionSplitter.h 2008-02-21
13:58:30.000000000 +0100
+++ new/yast2-libyui-2.16.41/src/YPartitionSplitter.h 2008-03-12
18:18:47.000000000 +0100
@@ -172,7 +172,7 @@
* The name of the widget property that will return user input.
* Inherited from YWidget.
**/
- const char *userInputProperty() { return YUIProperty_Value; }
+ const char * userInputProperty() { return YUIProperty_Value; }
private:
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn
--exclude=.svnignore old/yast2-libyui-2.16.39/src/YPushButton.cc
new/yast2-libyui-2.16.41/src/YPushButton.cc
--- old/yast2-libyui-2.16.39/src/YPushButton.cc 2008-02-21 13:58:30.000000000
+0100
+++ new/yast2-libyui-2.16.41/src/YPushButton.cc 2008-04-03 14:22:30.000000000
+0200
@@ -36,11 +36,13 @@
: label( label )
, isDefaultButton( false )
, setDefaultButtonRecursive( false )
+ , isHelpButton( false )
{}
string label;
bool isDefaultButton;
bool setDefaultButtonRecursive;
+ bool isHelpButton;
};
@@ -113,6 +115,19 @@
}
+bool YPushButton::isHelpButton() const
+{
+ return priv->isHelpButton;
+}
+
+
+void YPushButton::setHelpButton( bool helpButton )
+{
+ priv->isHelpButton = helpButton;
+}
+
+
+
const YPropertySet &
YPushButton::propertySet()
{
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn
--exclude=.svnignore old/yast2-libyui-2.16.39/src/YPushButton.h
new/yast2-libyui-2.16.41/src/YPushButton.h
--- old/yast2-libyui-2.16.39/src/YPushButton.h 2008-02-21 13:58:30.000000000
+0100
+++ new/yast2-libyui-2.16.41/src/YPushButton.h 2008-04-03 14:27:02.000000000
+0200
@@ -60,6 +60,15 @@
virtual void setLabel( const string & label );
/**
+ * Set this button's icon from an icon file in the UI's default icon
+ * directory. Clear the icon if the name is empty.
+ *
+ * This default implementation does nothing.
+ * UIs that can handle icons can choose to overwrite this method.
+ **/
+ virtual void setIcon( const string & iconName ) {}
+
+ /**
* Returns 'true' if this is the dialog's default button, i.e. the one
* button that gets activated if the user hits the [Return] key anywhere in
* the dialog.
@@ -70,18 +79,32 @@
* Make this button the default button.
*
* Derived classes should reimplement this, but call this base class
- * function in the overwritten function.
+ * function in the overwritten function.
**/
virtual void setDefaultButton( bool def = true );
/**
- * Set this button's icon from an icon file in the UI's default icon
- * directory. Clear the icon if the name is empty.
+ * Returns 'true' if this is a "Help" button.
*
- * This default implementation does nothing.
- * UIs that can handle icons can choose to overwrite this method.
+ * When activated, a help button will traverse up its widget hierarchy and
+ * search for the topmost widget with a helpText() set and display that
+ * help text in a pop-up dialog (with a local event loop).
+ *
+ * NOTE that this is only done during YDialog::waitForEvent() (i.e. in YCP
+ * UI::WaitForEvent(), UI::UserInput(), UI::TimeoutUserInput() ) and not
+ * during YDialog::pollEvent() (i.e. YCP UI::PollInput()) since displaying
+ * the help text will block the application until the user closes the help
+ * text.
**/
- virtual void setIcon( const string & iconName ) {}
+ bool isHelpButton() const;
+
+ /**
+ * Make this button a help button.
+ *
+ * Derived classes are free to reimplement this, but they should call this
+ * base class method in the overloaded function.
+ **/
+ virtual void setHelpButton( bool helpButton = true );
/**
* Set a property.
@@ -111,7 +134,7 @@
* Reimplemented from YWidget.
**/
virtual const YPropertySet & propertySet();
-
+
/**
* Get the string of this widget that holds the keyboard shortcut.
*
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn
--exclude=.svnignore old/yast2-libyui-2.16.39/src/YSelectionBox.h
new/yast2-libyui-2.16.41/src/YSelectionBox.h
--- old/yast2-libyui-2.16.39/src/YSelectionBox.h 2008-02-21
13:58:30.000000000 +0100
+++ new/yast2-libyui-2.16.41/src/YSelectionBox.h 2008-03-12
18:17:45.000000000 +0100
@@ -140,7 +140,7 @@
* The name of the widget property that will return user input.
* Inherited from YWidget.
**/
- const char *userInputProperty() { return YUIProperty_CurrentItem; }
+ const char * userInputProperty() { return YUIProperty_CurrentItem; }
private:
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn
--exclude=.svnignore old/yast2-libyui-2.16.39/src/YTable.h
new/yast2-libyui-2.16.41/src/YTable.h
--- old/yast2-libyui-2.16.39/src/YTable.h 2008-02-21 13:58:30.000000000
+0100
+++ new/yast2-libyui-2.16.41/src/YTable.h 2008-03-12 18:18:49.000000000
+0100
@@ -176,7 +176,7 @@
* The name of the widget property that will return user input.
* Inherited from YWidget.
**/
- const char *userInputProperty() { return YUIProperty_CurrentItem; }
+ const char * userInputProperty() { return YUIProperty_CurrentItem; }
protected:
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn
--exclude=.svnignore old/yast2-libyui-2.16.39/src/YTree.h
new/yast2-libyui-2.16.41/src/YTree.h
--- old/yast2-libyui-2.16.39/src/YTree.h 2008-02-21 13:58:30.000000000
+0100
+++ new/yast2-libyui-2.16.41/src/YTree.h 2008-03-12 18:18:51.000000000
+0100
@@ -142,7 +142,7 @@
* The name of the widget property that will return user input.
* Inherited from YWidget.
**/
- const char *userInputProperty() { return YUIProperty_CurrentItem; }
+ const char * userInputProperty() { return YUIProperty_CurrentItem; }
private:
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn
--exclude=.svnignore old/yast2-libyui-2.16.39/src/YUILog.cc
new/yast2-libyui-2.16.41/src/YUILog.cc
--- old/yast2-libyui-2.16.39/src/YUILog.cc 2008-03-06 14:12:45.000000000
+0100
+++ new/yast2-libyui-2.16.41/src/YUILog.cc 2008-03-20 19:14:06.000000000
+0100
@@ -18,7 +18,9 @@
#include <string.h>
-#include <string>
+
+#include <ostream>
+#include <fstream>
#include <vector>
#include <pthread.h>
@@ -28,19 +30,19 @@
#include "YUIException.h"
using std::ostream;
+using std::ofstream;
using std::cerr;
using std::endl;
-using std::string;
using std::vector;
-static void
-stderrLogger( YUILogLevel_t logLevel,
- const char * logComponent,
- const char * sourceFileName,
- int sourceLineNo,
- const char * sourceFunctionName,
- const char * message );
+static void stdLogger( YUILogLevel_t logLevel,
+ const char * logComponent,
+ const char * sourceFileName,
+ int sourceLineNo,
+ const char * sourceFunctionName,
+ const char * message );
+static ostream * stdLogStream = &cerr;
/**
@@ -250,7 +252,7 @@
* Constructor
**/
YUILogPrivate()
- : loggerFunction( stderrLogger )
+ : loggerFunction( stdLogger )
, enableDebugLoggingHook( 0 )
, debugLoggingEnabledHook( 0 )
, enableDebugLogging( false )
@@ -295,6 +297,8 @@
// Data members
//
+ string logFileName;
+ ofstream stdLogStream;
YUILoggerFunction loggerFunction;
YUIEnableDebugLoggingFunction enableDebugLoggingHook;
YUIDebugLoggingEnabledFunction debugLoggingEnabledHook;
@@ -315,6 +319,8 @@
YUILog::~YUILog()
{
+ if ( priv->stdLogStream.is_open() )
+ priv->stdLogStream.close();
}
@@ -333,6 +339,49 @@
}
+bool
+YUILog::setLogFileName( const string & logFileName )
+{
+ instance()->priv->logFileName = logFileName;
+
+ ofstream & logStream = instance()->priv->stdLogStream;
+
+ if ( logStream.is_open() )
+ logStream.close();
+
+ bool success = true;
+
+ if ( logFileName.empty() ) // log to stderr again
+ {
+ stdLogStream = &cerr;
+ }
+ else
+ {
+ logStream.open( logFileName.c_str(), std::ios_base::app );
+ success = logStream.good();
+
+ if ( success )
+ {
+ stdLogStream = &( instance()->priv->stdLogStream );
+ }
+ else
+ {
+ cerr << "ERROR: Can't open log file " << logFileName << endl;
+ stdLogStream = &cerr;
+ }
+ }
+
+ return success;
+}
+
+
+string
+YUILog::logFileName()
+{
+ return instance()->priv->logFileName;
+}
+
+
void
YUILog::enableDebugLogging( bool debugLogging )
{
@@ -357,18 +406,18 @@
YUILog::setLoggerFunction( YUILoggerFunction loggerFunction )
{
if ( ! loggerFunction )
- loggerFunction = stderrLogger;
+ loggerFunction = stdLogger;
instance()->priv->loggerFunction = loggerFunction;
}
YUILoggerFunction
-YUILog::loggerFunction( bool returnStderrLogger )
+YUILog::loggerFunction( bool returnStdLogger )
{
YUILoggerFunction logger = instance()->priv->loggerFunction;
- if ( logger == stderrLogger && ! returnStderrLogger )
+ if ( logger == stdLogger && ! returnStdLogger )
logger = 0;
return logger;
@@ -458,22 +507,23 @@
static void
-stderrLogger( YUILogLevel_t logLevel,
- const char * logComponent,
- const char * sourceFileName,
- int sourceLineNo,
- const char * sourceFunctionName,
- const char * message )
+stdLogger( YUILogLevel_t logLevel,
+ const char * logComponent,
+ const char * sourceFileName,
+ int sourceLineNo,
+ const char * sourceFunctionName,
+ const char * message )
{
const char * logLevelStr = "";
switch ( logLevel )
{
- case YUI_LOG_DEBUG: if ( ! YUILog::debugLoggingEnabled )
- return;
+ case YUI_LOG_DEBUG:
+ if ( ! YUILog::debugLoggingEnabled() )
+ return;
- logLevelStr = "dbg";
- break;
+ logLevelStr = "dbg";
+ break;
case YUI_LOG_MILESTONE: logLevelStr = "_M_"; break;
case YUI_LOG_WARNING: logLevelStr = "WRN"; break;
@@ -492,10 +542,10 @@
if ( ! message )
message = "";
- cerr << "<" << logLevelStr << "> "
- << "[" << logComponent << "] "
- << sourceFileName << ":" << sourceLineNo << " "
- << sourceFunctionName << "(): "
- << message
- << endl;
+ (*stdLogStream) << "<" << logLevelStr << "> "
+ << "[" << logComponent << "] "
+ << sourceFileName << ":" << sourceLineNo << " "
+ << sourceFunctionName << "(): "
+ << message
+ << endl;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn
--exclude=.svnignore old/yast2-libyui-2.16.39/src/YUILog.h
new/yast2-libyui-2.16.41/src/YUILog.h
--- old/yast2-libyui-2.16.39/src/YUILog.h 2008-03-05 16:50:23.000000000
+0100
+++ new/yast2-libyui-2.16.41/src/YUILog.h 2008-03-20 18:32:46.000000000
+0100
@@ -23,9 +23,11 @@
#endif
#include <iostream>
+#include <string>
#include "ImplPtr.h"
+
//
// UI Logging: Macros for Application use.
//
@@ -54,6 +56,7 @@
using std::dec;
using std::boolalpha;
using std::noboolalpha;
+using std::string;
//
// ------ End of user relevant part ------
@@ -105,14 +108,14 @@
static std::ostream & error ( const char * logComponent, const char *
sourceFileName, int lineNo, const char * functionName );
/**
- * Generic log function.
+ * Generic log function. debug(), milestone() etc. ultimately all call
this function.
**/
std::ostream & log( YUILogLevel_t logLevel,
const char * logComponent,
const char * sourceFileName,
int lineNo,
const char * functionName );
-
+
/**
* Return the singleton object for this class.
* This will create the singleton if it doesn't exist yet.
@@ -130,6 +133,37 @@
static bool debugLoggingEnabled();
/**
+ * Set the log file name to be used with the standard logger function.
+ * Output will be appended to this file.
+ *
+ * Until this file name is set, the standard logger function logs to
stderr.
+ * Set the log file name to an empty string to log to stderr again.
+ *
+ * This returns 'true' upon success (opening the file was successful),
+ *'false' upon error.
+ *
+ *
+ * Notice:
+ *
+ * (1) This file name is only relevant as long as the standard logger
+ * function is used. Custom logger functions may or may not use this
+ * file name.
+ *
+ * (2) No attempt is made to do anything fancy with the log file like log
+ * file rotation when a certain file size is reached. Applications that
+ * need this should use a custom logger function.
+ * See also setLoggerFunction().
+ **/
+ static bool setLogFileName( const string & logFileName );
+
+ /**
+ * Return the current log file name or an empty string if stderr is used.
+ * Notice that this information is only relevant as long as the standard
+ * logger function is used.
+ **/
+ static string logFileName();
+
+ /**
* Set the UI logger function. This is the function that will ultimately
* receive all UI log output (except debug logging if debug logging is
* disabled).
@@ -143,10 +177,10 @@
* Return the UI logger function.
*
* If stderr is used for logging (i.e. no logger function set), 0 is
- * returned (unless 'returnStderrLogger' is 'true', in which case the
+ * returned (unless 'returnStdLogger' is 'true', in which case the
* internally used stderr-logger is returned).
**/
- static YUILoggerFunction loggerFunction( bool returnStderrLogger = false );
+ static YUILoggerFunction loggerFunction( bool returnStdLogger = false );
/**
* Set the hook functions to enable/disable debug logging and to query if
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn
--exclude=.svnignore old/yast2-libyui-2.16.39/src/YUISymbols.h
new/yast2-libyui-2.16.41/src/YUISymbols.h
--- old/yast2-libyui-2.16.39/src/YUISymbols.h 2008-02-21 13:58:30.000000000
+0100
+++ new/yast2-libyui-2.16.41/src/YUISymbols.h 2008-04-03 14:14:59.000000000
+0200
@@ -157,6 +157,7 @@
#define YUIProperty_Enabled "Enabled"
#define YUIProperty_ExpectedSize "ExpectedSize"
#define YUIProperty_Filename "Filename"
+#define YUIProperty_HelpText "HelpText"
#define YUIProperty_IconPath "IconPath"
#define YUIProperty_InputMaxLength "InputMaxLength"
#define YUIProperty_Item "Item"
@@ -195,6 +196,7 @@
#define YUIOpt_disabled "disabled"
#define YUIOpt_easterEgg "easterEgg"
#define YUIOpt_editable "editable"
+#define YUIOpt_helpButton "helpButton"
#define YUIOpt_hstretch "hstretch"
#define YUIOpt_hvstretch "hvstretch"
#define YUIOpt_immediate "immediate"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn
--exclude=.svnignore old/yast2-libyui-2.16.39/src/YWidget.cc
new/yast2-libyui-2.16.41/src/YWidget.cc
--- old/yast2-libyui-2.16.39/src/YWidget.cc 2008-02-21 13:58:30.000000000
+0100
+++ new/yast2-libyui-2.16.41/src/YWidget.cc 2008-04-01 17:43:20.000000000
+0200
@@ -19,6 +19,7 @@
#include <signal.h>
#include <iostream>
+#include <sstream>
#define YUILogComponent "ui"
#include "YUILog.h"
@@ -40,6 +41,7 @@
#define YWIDGET_MAGIC 42
#define CHECK_FOR_DUPLICATE_CHILDREN 1
+#define LOG_WIDGET_REP 0
using std::string;
@@ -86,6 +88,7 @@
YBothDim<int> weight;
int functionKey;
string widgetName;
+ string helpText;
};
@@ -338,7 +341,18 @@
{
priv->widgetName = name;
}
-
+
+
+string YWidget::helpText() const
+{
+ return priv->helpText;
+}
+
+
+void YWidget::setHelpText( const string & helpText )
+{
+ priv->helpText = helpText;
+}
YWidgetID *
@@ -348,8 +362,7 @@
}
-void
-YWidget::setId( YWidgetID * newId )
+void YWidget::setId( YWidgetID * newId )
{
if ( priv->id )
delete priv->id;
@@ -358,8 +371,7 @@
}
-bool
-YWidget::hasId() const
+bool YWidget::hasId() const
{
return priv->id != 0;
}
@@ -395,6 +407,7 @@
* @property boolean Notify the current notify state (see
also `opt( `notify ))
* @property string WidgetClass the widget class of this widget
(YLabel, YPushButton, ...)
* @property string WidgetName internal name for this widget
(by default the string-ized ID)
+ * @property string HelpText help text
* @property string DebugLabel (possibly translated) text
describing this widget for debugging
**/
@@ -403,6 +416,7 @@
propSet.add( YProperty( YUIProperty_WidgetClass,
YStringProperty, true ) ); // read-only
propSet.add( YProperty( YUIProperty_DebugLabel,
YStringProperty, true ) ); // read-only
propSet.add( YProperty( YUIProperty_WidgetName, YStringProperty
) );
+ propSet.add( YProperty( YUIProperty_HelpText, YStringProperty
) );
}
return propSet;
@@ -425,6 +439,7 @@
if ( propertyName == YUIProperty_Enabled ) setEnabled(
val.boolVal() );
else if ( propertyName == YUIProperty_Notify ) setNotify (
val.boolVal() );
else if ( propertyName == YUIProperty_WidgetName ) setWidgetName(
val.stringVal() );
+ else if ( propertyName == YUIProperty_HelpText ) setHelpText(
val.stringVal() );
return true; // success -- no special processing necessary
}
@@ -447,6 +462,7 @@
if ( propertyName == YUIProperty_Notify ) return
YPropertyValue( notify() );
if ( propertyName == YUIProperty_WidgetClass ) return
YPropertyValue( widgetClass() );
if ( propertyName == YUIProperty_WidgetName ) return
YPropertyValue( widgetName() );
+ if ( propertyName == YUIProperty_HelpText ) return
YPropertyValue( helpText() );
if ( propertyName == YUIProperty_DebugLabel ) return
YPropertyValue( debugLabel() );
return YPropertyValue( false ); // NOTREACHED
@@ -650,16 +666,27 @@
void YWidget::dumpWidget( YWidget *w, int indentationLevel )
{
+ std::ostringstream str;
+
string indentation ( indentationLevel * 4, ' ' );
+ str << "Widget tree: " << indentation << w;
+
+ if ( w->widgetRep() )
+ {
+ str << " (widgetRep: "
+ << hex << w->widgetRep() << dec
+ << ")";
+ }
+
string stretch;
if ( w->stretchable( YD_HORIZ ) ) stretch += "hstretch ";
if ( w->stretchable( YD_VERT ) ) stretch += "vstretch";
if ( ! stretch.empty() )
- stretch = " (" + stretch + ") ";
+ str << " ( " << stretch << " ) ";
- yuiMilestone() << indentation << "Widget tree: " << w << stretch << endl;
+ yuiMilestone() << str.str() << endl;
}
@@ -669,7 +696,7 @@
//
// Record this widget's user input property (if there is any)
//
-
+
if ( userInputProperty() )
{
macroRecorder->recordWidgetProperty( this, userInputProperty() );
@@ -678,7 +705,7 @@
//
// Record the child widgets' (if there are any) user input
//
-
+
for ( YWidgetListConstIterator it = childrenBegin();
it != childrenEnd();
++it )
@@ -721,12 +748,14 @@
stream << " at " << hex << (void *) w << dec;
+#if LOG_WIDGET_REP
if ( w->widgetRep() )
{
stream << " (widgetRep: "
<< hex << w->widgetRep() << dec
<< ")";
}
+#endif
}
else
{
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn
--exclude=.svnignore old/yast2-libyui-2.16.39/src/YWidget.h
new/yast2-libyui-2.16.41/src/YWidget.h
--- old/yast2-libyui-2.16.39/src/YWidget.h 2008-02-21 13:58:30.000000000
+0100
+++ new/yast2-libyui-2.16.41/src/YWidget.h 2008-04-01 17:47:49.000000000
+0200
@@ -89,6 +89,20 @@
**/
void setWidgetName( const string & name );
+ /**
+ * Return the help text for this widget.
+ **/
+ string helpText() const;
+
+ /**
+ * Set a help text for this widget.
+ *
+ * Currently, the UI does not do anything with this text but store it.
+ * Displaying the text at a convenient time is currently the application's
+ * responsibility. This may change in future versions.
+ **/
+ void setHelpText( const string & helpText );
+
//
// Property Management
@@ -435,7 +449,7 @@
/**
* Sets the Notify property
**/
- void setNotify( bool notify );
+ void setNotify( bool notify = true );
/**
* Returns whether the widget will notify, i.e. will case UserInput to
@@ -518,7 +532,7 @@
* SelBox) should overwrite this methods. Widgets that are purely passive
* (such as Label, RichText) should not.
**/
- virtual const char *userInputProperty() { return (const char *) 0; }
+ virtual const char * userInputProperty() { return (const char *) 0; }
/**
* Debugging function:
@@ -545,7 +559,7 @@
/**
* Recursively save the user input of all child widgets to a macro
- * recorder:
+ * recorder:
*
* All child widgets that could contain data entered by the user
* are requested to send their contents to the macro recorder, e.g. input
@@ -559,7 +573,7 @@
*
* Widgets that need another number of properties recorded should
* reimplement this method (and NOT call this default method in the new
- * implementation).
+ * implementation).
**/
virtual void saveUserInput( YMacroRecorder *macroRecorder );
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn
--exclude=.svnignore old/yast2-libyui-2.16.39/VERSION
new/yast2-libyui-2.16.41/VERSION
--- old/yast2-libyui-2.16.39/VERSION 2008-03-05 16:52:46.000000000 +0100
+++ new/yast2-libyui-2.16.41/VERSION 2008-04-01 17:48:18.000000000 +0200
@@ -1 +1 @@
-2.16.39
+2.16.41
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-commit+help@xxxxxxxxxxxx
| < Previous | Next > |