Hello community,
here is the log from the commit of package yast2-qt
checked in at Thu May 1 14:51:39 CEST 2008.
--------
--- yast2-qt/yast2-qt.changes 2008-04-29 17:07:08.000000000 +0200
+++ /mounts/work_src_done/STABLE/yast2-qt/yast2-qt.changes 2008-04-30 17:44:26.121458000 +0200
@@ -1,0 +2,6 @@
+Wed Apr 30 17:43:03 CEST 2008 - sh@suse.de
+
+- Fixed bnc #379904: More than one radio button checked
+- V 2.16.45
+
+-------------------------------------------------------------------
Old:
----
yast2-qt-2.16.44.tar.bz2
New:
----
yast2-qt-2.16.45.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-qt.spec ++++++
--- /var/tmp/diff_new_pack.bR4924/_old 2008-05-01 14:50:50.000000000 +0200
+++ /var/tmp/diff_new_pack.bR4924/_new 2008-05-01 14:50:50.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-qt (Version 2.16.44)
+# spec file for package yast2-qt (Version 2.16.45)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -11,12 +11,12 @@
Name: yast2-qt
-Version: 2.16.44
+Version: 2.16.45
Release: 1
License: GPL v2 or later
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-qt-2.16.44.tar.bz2
+Source0: yast2-qt-2.16.45.tar.bz2
BuildRequires: docbook-xsl-stylesheets
BuildRequires: doxygen
BuildRequires: libdrm-devel
@@ -112,6 +112,9 @@
%_includedir/*
%changelog
+* Wed Apr 30 2008 sh@suse.de
+- Fixed bnc #379904: More than one radio button checked
+- V 2.16.45
* Tue Apr 29 2008 sh@suse.de
- Fixed bnc #383672 - Busy cursor in file dialogs
- V 2.16.44
++++++ yast2-qt-2.16.44.tar.bz2 -> yast2-qt-2.16.45.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-qt-2.16.44/package/yast2-qt.changes new/yast2-qt-2.16.45/package/yast2-qt.changes
--- old/yast2-qt-2.16.44/package/yast2-qt.changes 2008-04-29 17:06:29.000000000 +0200
+++ new/yast2-qt-2.16.45/package/yast2-qt.changes 2008-04-30 17:44:10.000000000 +0200
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Wed Apr 30 17:43:03 CEST 2008 - sh@suse.de
+
+- Fixed bnc #379904: More than one radio button checked
+- V 2.16.45
+
+-------------------------------------------------------------------
Tue Apr 29 17:05:40 CEST 2008 - sh@suse.de
- Fixed bnc #383672 - Busy cursor in file dialogs
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-qt-2.16.44/src/YQRadioButton.cc new/yast2-qt-2.16.45/src/YQRadioButton.cc
--- old/yast2-qt-2.16.44/src/YQRadioButton.cc 2008-04-29 17:06:29.000000000 +0200
+++ new/yast2-qt-2.16.45/src/YQRadioButton.cc 2008-04-30 17:44:10.000000000 +0200
@@ -50,6 +50,12 @@
{
setWidgetRep( this );
+ // QRadioButton uses its own logic by default to make sure that only one
+ // button of a radio box is checked at any time, but this interferes with
+ // YRadioButtonGroup. Let YRadioButtonGroup and YQRadioButton::changed()
+ // handle this.
+ setAutoExclusive( false );
+
setChecked( checked );
installEventFilter(this);
@@ -98,6 +104,7 @@
{
YQSignalBlocker sigBlocker( this );
+ // yuiDebug() << "Setting " << this << (newValue ? " on" : " off") << endl;
setChecked( newValue );
if ( newValue )
@@ -132,12 +139,19 @@
}
-// slots
-
void YQRadioButton::changed( bool newState )
{
- if ( notify() && newState )
- YQUI::ui()->sendEvent( new YWidgetEvent( this, YEvent::ValueChanged ) );
+ if ( newState )
+ {
+ yuiDebug() << "User set " << this << ( newState ? " on" : " off" ) << endl;
+ YRadioButtonGroup * group = buttonGroup();
+
+ if ( group )
+ group->uncheckOtherButtons( this );
+
+ if ( notify() )
+ YQUI::ui()->sendEvent( new YWidgetEvent( this, YEvent::ValueChanged ) );
+ }
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-qt-2.16.44/src/YQRadioButton.cc.bak new/yast2-qt-2.16.45/src/YQRadioButton.cc.bak
--- old/yast2-qt-2.16.44/src/YQRadioButton.cc.bak 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-qt-2.16.45/src/YQRadioButton.cc.bak 2008-04-30 17:44:10.000000000 +0200
@@ -0,0 +1,161 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: YQRadioButton.cc
+
+ Author: Stefan Hundhammer
+
+/-*/
+
+#include
+#include <QMouseEvent>
+#include <QBoxLayout>
+
+#define YUILogComponent "qt-ui"
+#include "YUILog.h"
+
+#include "utf8.h"
+#include "YQUI.h"
+#include "YQApplication.h"
+#include "YEvent.h"
+#include "YQRadioButton.h"
+#include "YRadioButtonGroup.h"
+#include "YQSignalBlocker.h"
+
+using std::string;
+
+#define SPACING 8
+
+// +----+----------------------------------+----+
+// | |(o) RadioButtonlabel | |
+// +----+----------------------------------+----+
+// <----> SPACING <---->
+
+
+
+YQRadioButton::YQRadioButton( YWidget * parent,
+ const string & label,
+ bool checked )
+ : QRadioButton( fromUTF8( label ), ( QWidget *) (parent->widgetRep() ) )
+ , YRadioButton( parent, label )
+{
+ setWidgetRep( this );
+
+ setChecked( checked );
+
+ installEventFilter(this);
+
+ connect ( this, SIGNAL( toggled ( bool ) ),
+ this, SLOT ( changed ( bool ) ) );
+}
+
+
+void
+YQRadioButton::setUseBoldFont( bool useBold )
+{
+ setFont( useBold ?
+ YQUI::yqApp()->boldFont() :
+ YQUI::yqApp()->currentFont() );
+
+ YRadioButton::setUseBoldFont( useBold );
+}
+
+
+int YQRadioButton::preferredWidth()
+{
+ return sizeHint().width();
+}
+
+
+int YQRadioButton::preferredHeight()
+{
+ return sizeHint().height();
+}
+
+
+void YQRadioButton::setSize( int newWidth, int newHeight )
+{
+ resize( newWidth, newHeight );
+}
+
+
+bool YQRadioButton::value()
+{
+ return isChecked();
+}
+
+
+void YQRadioButton::setValue( bool newValue )
+{
+ YQSignalBlocker sigBlocker( this );
+
+ setChecked( newValue );
+
+ if ( newValue )
+ {
+ YRadioButtonGroup * group = buttonGroup();
+
+ if ( group )
+ group->uncheckOtherButtons( this );
+ }
+}
+
+
+void YQRadioButton::setLabel( const string & label )
+{
+ setText( fromUTF8( label ) );
+ YRadioButton::setLabel( label );
+}
+
+
+void YQRadioButton::setEnabled( bool enabled )
+{
+ QRadioButton::setEnabled( enabled );
+ YWidget::setEnabled( enabled );
+}
+
+
+bool YQRadioButton::setKeyboardFocus()
+{
+ setFocus();
+
+ return true;
+}
+
+
+// slots
+
+void YQRadioButton::changed( bool newState )
+{
+ if ( notify() && newState )
+ YQUI::ui()->sendEvent( new YWidgetEvent( this, YEvent::ValueChanged ) );
+}
+
+
+bool YQRadioButton::eventFilter( QObject * obj, QEvent * event )
+{
+ if ( event && event->type() == QEvent::MouseButtonRelease )
+ {
+ QMouseEvent * mouseEvent = dynamic_cast (event);
+
+ if ( mouseEvent && mouseEvent->button() == Qt::RightButton )
+ {
+ yuiMilestone() << "Right click on button detected" << endl;
+ YQUI::yqApp()->maybeLeftHandedUser();
+ }
+ }
+
+ return QObject::eventFilter( obj, event );
+}
+
+
+#include "YQRadioButton.moc"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-qt-2.16.44/src/YQRadioButtonGroup.cc new/yast2-qt-2.16.45/src/YQRadioButtonGroup.cc
--- old/yast2-qt-2.16.44/src/YQRadioButtonGroup.cc 2008-04-29 17:06:29.000000000 +0200
+++ new/yast2-qt-2.16.45/src/YQRadioButtonGroup.cc 2008-04-30 17:44:10.000000000 +0200
@@ -23,12 +23,12 @@
#include "YQRadioButtonGroup.h"
#include "YQRadioButton.h"
+#include "qstring.h"
YQRadioButtonGroup::YQRadioButtonGroup( YWidget * parent )
: QWidget( (QWidget *) parent->widgetRep() )
, YRadioButtonGroup( parent )
- , _recursive( false )
{
setWidgetRep( this );
}
@@ -47,13 +47,8 @@
if ( button->value() ) // if this new button is active
{
- uncheckOtherButtons( button ); // make it the only active
+ uncheckOtherButtons( button ); // make it the only active one
}
-
- QRadioButton * radio_button = dynamic_cast( button );
-
- connect ( radio_button, SIGNAL ( toggled ( bool ) ),
- this, SLOT ( radioButtonClicked( bool ) ) );
}
@@ -73,47 +68,4 @@
}
-void
-YQRadioButtonGroup::radioButtonClicked( bool newState )
-{
- // Prevent infinite recursion: YQRadioButton::setValue() might cause Qt
- // signals that would cause recursion to this place.
-
- if ( _recursive )
- return;
-
- _recursive = true;
-
- QRadioButton * senderButton = (QRadioButton *) sender();
-
- // Implement radio box behaviour: Uncheck all other radio buttons
-
- for ( YRadioButtonListConstIterator it = radioButtonsBegin();
- it != radioButtonsEnd();
- ++it )
- {
- YQRadioButton * radioButton = dynamic_cast (*it);
-
- if ( radioButton )
- {
- if ( radioButton == senderButton )
- {
- // If this button has been clicked, it is to be the RadioBox's
- // active button - regardless of newState. This is to avoid
- // RadioBoxes where no single button is active; otherwise the
- // second click would deactivate the only active button.
-
- radioButton->setValue( true );
- }
- else
- {
- radioButton->setValue( false );
- }
- }
- }
-
- _recursive = false;
-}
-
-
#include "YQRadioButtonGroup.moc"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-qt-2.16.44/src/YQRadioButtonGroup.cc.bak new/yast2-qt-2.16.45/src/YQRadioButtonGroup.cc.bak
--- old/yast2-qt-2.16.44/src/YQRadioButtonGroup.cc.bak 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-qt-2.16.45/src/YQRadioButtonGroup.cc.bak 2008-04-30 17:44:10.000000000 +0200
@@ -0,0 +1,119 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: YQRadioButtonGroup.cc
+
+ Author: Stefan Hundhammer
+
+/-*/
+
+
+#include <QRadioButton>
+#define YUILogComponent "qt-ui"
+#include "YUILog.h"
+
+#include "YQRadioButtonGroup.h"
+#include "YQRadioButton.h"
+
+
+YQRadioButtonGroup::YQRadioButtonGroup( YWidget * parent )
+ : QWidget( (QWidget *) parent->widgetRep() )
+ , YRadioButtonGroup( parent )
+ , _recursive( false )
+{
+ setWidgetRep( this );
+}
+
+
+YQRadioButtonGroup::~YQRadioButtonGroup()
+{
+ // NOP
+}
+
+
+void
+YQRadioButtonGroup::addRadioButton( YRadioButton * button )
+{
+ YRadioButtonGroup::addRadioButton( button );
+
+ if ( button->value() ) // if this new button is active
+ {
+ uncheckOtherButtons( button ); // make it the only active
+ }
+
+ QRadioButton * radio_button = dynamic_cast( button );
+
+ connect ( radio_button, SIGNAL ( toggled ( bool ) ),
+ this, SLOT ( radioButtonClicked( bool ) ) );
+}
+
+
+void
+YQRadioButtonGroup::setEnabled( bool enabled )
+{
+ QWidget::setEnabled( enabled );
+ YWidget::setEnabled( enabled );
+}
+
+
+void
+YQRadioButtonGroup::setSize( int newWidth, int newHeight )
+{
+ resize( newWidth, newHeight );
+ YRadioButtonGroup::setSize( newWidth, newHeight );
+}
+
+
+void
+YQRadioButtonGroup::radioButtonClicked( bool newState )
+{
+ // Prevent infinite recursion: YQRadioButton::setValue() might cause Qt
+ // signals that would cause recursion to this place.
+
+ if ( _recursive )
+ return;
+
+ _recursive = true;
+
+ QRadioButton * senderButton = (QRadioButton *) sender();
+
+ // Implement radio box behaviour: Uncheck all other radio buttons
+
+ for ( YRadioButtonListConstIterator it = radioButtonsBegin();
+ it != radioButtonsEnd();
+ ++it )
+ {
+ YQRadioButton * radioButton = dynamic_cast (*it);
+
+ if ( radioButton )
+ {
+ if ( radioButton == senderButton )
+ {
+ // If this button has been clicked, it is to be the RadioBox's
+ // active button - regardless of newState. This is to avoid
+ // RadioBoxes where no single button is active; otherwise the
+ // second click would deactivate the only active button.
+
+ radioButton->setValue( true );
+ }
+ else
+ {
+ radioButton->setValue( false );
+ }
+ }
+ }
+
+ _recursive = false;
+}
+
+
+#include "YQRadioButtonGroup.moc"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-qt-2.16.44/src/YQRadioButtonGroup.h new/yast2-qt-2.16.45/src/YQRadioButtonGroup.h
--- old/yast2-qt-2.16.44/src/YQRadioButtonGroup.h 2008-04-29 17:06:29.000000000 +0200
+++ new/yast2-qt-2.16.45/src/YQRadioButtonGroup.h 2008-04-30 17:44:10.000000000 +0200
@@ -58,24 +58,6 @@
* Reimplemented from YWidget.
**/
virtual void setSize( int newWidth, int newHeight );
-
-
-private slots:
-
- /**
- * Triggered when one of the radio buttons changed state.
- * This implements the radio box behaviour, i.e. unselects all but the last
- * selected radio button.
- **/
- void radioButtonClicked( bool newState );
-
-
-private:
-
- /**
- * Used to prevent infinite recursion due to signal race conditions.
- **/
- bool _recursive;
};
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-qt-2.16.44/src/YQRadioButtonGroup.h.bak new/yast2-qt-2.16.45/src/YQRadioButtonGroup.h.bak
--- old/yast2-qt-2.16.44/src/YQRadioButtonGroup.h.bak 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-qt-2.16.45/src/YQRadioButtonGroup.h.bak 2008-04-30 17:44:10.000000000 +0200
@@ -0,0 +1,82 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: YQRadioButtonGroup.h
+
+ Author: Stefan Hundhammer
+
+/-*/
+
+#ifndef YQRadioButtonGroup_h
+#define YQRadioButtonGroup_h
+
+#include <QWidget>
+#include "YRadioButtonGroup.h"
+
+
+class YQRadioButtonGroup : public QWidget, public YRadioButtonGroup
+{
+ Q_OBJECT
+
+public:
+ /**
+ * Constructor.
+ **/
+ YQRadioButtonGroup( YWidget * parent );
+
+ /**
+ * Destructor.
+ **/
+ virtual ~YQRadioButtonGroup();
+
+ /**
+ * Add a RadioButton.
+ *
+ * Reimplemented from YRadioButtonGroup.
+ **/
+ virtual void addRadioButton( YRadioButton * button );
+
+ /**
+ * Set enabled/disabled state.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual void setEnabled( bool enabled );
+
+ /**
+ * Set the new size of the widget.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual void setSize( int newWidth, int newHeight );
+
+
+private slots:
+
+ /**
+ * Triggered when one of the radio buttons changed state.
+ * This implements the radio box behaviour, i.e. unselects all but the last
+ * selected radio button.
+ **/
+ void radioButtonClicked( bool newState );
+
+
+private:
+
+ /**
+ * Used to prevent infinite recursion due to signal race conditions.
+ **/
+ bool _recursive;
+};
+
+
+#endif // YQRadioButtonGroup_h
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-qt-2.16.44/VERSION.cmake new/yast2-qt-2.16.45/VERSION.cmake
--- old/yast2-qt-2.16.44/VERSION.cmake 2008-04-29 17:06:29.000000000 +0200
+++ new/yast2-qt-2.16.45/VERSION.cmake 2008-04-30 17:44:10.000000000 +0200
@@ -1,3 +1,3 @@
SET(VERSION_MAJOR "2")
SET(VERSION_MINOR "16")
-SET(VERSION_PATCH "44")
+SET(VERSION_PATCH "45")
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org