Author: sh-sh-sh
Date: Mon Jun 18 17:26:33 2007
New Revision: 38511
URL: http://svn.opensuse.org/viewcvs/yast?rev=38511&view=rev
Log:
migrated PushButton
Modified:
branches/tmp/sh/mod-ui/qt/src/YQDialog.cc
branches/tmp/sh/mod-ui/qt/src/YQGenericButton.cc
branches/tmp/sh/mod-ui/qt/src/YQGenericButton.h
branches/tmp/sh/mod-ui/qt/src/YQPushButton.cc
branches/tmp/sh/mod-ui/qt/src/YQPushButton.h
branches/tmp/sh/mod-ui/qt/src/YQUI.h
branches/tmp/sh/mod-ui/qt/src/YQUI_widgets.cc
branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.cc
branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.h
branches/tmp/sh/mod-ui/qt/src/YQWizard.cc
branches/tmp/sh/mod-ui/qt/src/YQWizardButton.cc
branches/tmp/sh/mod-ui/qt/src/YQWizardButton.h
Modified: branches/tmp/sh/mod-ui/qt/src/YQDialog.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQDialog.cc?rev=38511&r1=38510&r2=38511&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQDialog.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQDialog.cc Mon Jun 18 17:26:33 2007
@@ -228,7 +228,7 @@
{
YQGenericButton * button = dynamic_cast ( *it );
- if ( button && button->isDefault() )
+ if ( button && button->isDefaultButton() )
{
_defaultButton = button;
@@ -264,7 +264,7 @@
}
else if ( button )
{
- if ( button->isDefault() )
+ if ( button->isDefaultButton() )
{
if ( _defaultButton && button != _defaultButton )
{
@@ -361,13 +361,13 @@
if ( dynamic_cast( _defaultButton ) )
{
// Let app defined default buttons override wizard buttons
- _defaultButton->setDefault( false );
+ _defaultButton->setDefaultButton( false );
}
else
{
y2error( "Too many `opt(`default) PushButtons: [%s]",
(const char *) newDefaultButton->text() );
- newDefaultButton->setDefault( false );
+ newDefaultButton->setDefaultButton( false );
return;
}
}
@@ -376,7 +376,7 @@
if ( _defaultButton )
{
- _defaultButton->setDefault( true );
+ _defaultButton->setDefaultButton( true );
y2debug( "New default button: [%s]", (const char *) _defaultButton->text() );
if ( _defaultButton && ! _focusButton )
Modified: branches/tmp/sh/mod-ui/qt/src/YQGenericButton.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQGenericButton.cc?rev=38511&r1=38510&r2=38511&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQGenericButton.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQGenericButton.cc Mon Jun 18 17:26:33 2007
@@ -30,17 +30,15 @@
#include "YQDialog.h"
-YQGenericButton::YQGenericButton( QWidget * parent,
- YQDialog * dialog,
- const YWidgetOpt & opt,
- const std::string & label )
- : QWidget( parent )
- , YPushButton( opt, label )
- , _dialog( dialog )
+YQGenericButton::YQGenericButton( YWidget * parent,
+ const string & label )
+ : QWidget( (QWidget *) parent->widgetRep() )
+ , YPushButton( parent, label )
+ , _dialog( 0 )
+ , _qPushButton( 0 )
+ , _setDefaultButtonRecursive( false )
{
setWidgetRep( 0 );
-
- _isDefault = opt.isDefaultButton.value();
}
@@ -52,19 +50,53 @@
_qPushButton->setAutoDefault( true );
YPushButton::setLabel( toUTF8 ( _qPushButton->text() ) );
-
- if ( _dialog && _isDefault )
- _dialog->setDefaultButton( this );
}
YQGenericButton::~YQGenericButton()
{
- if ( _dialog->focusButton() == this )
- _dialog->losingFocus( this );
+ if ( _dialog ) // If we don't have one any more, don't bother
+ {
+ if ( _dialog->focusButton() == this )
+ _dialog->losingFocus( this );
+
+ if ( _dialog->defaultButton() == this )
+ _dialog->setDefaultButton(0);
+ }
+}
+
+
+YQDialog *
+YQGenericButton::dialog()
+{
+ if ( ! _dialog )
+ {
+ YDialog * yDialog = findDialog();
+
+ if ( yDialog )
+ _dialog = dynamic_cast (yDialog);
+
+ YUI_CHECK_PTR( _dialog );
+ }
+
+ return _dialog;
+}
+
+
+void
+YQGenericButton::setDefaultButton( bool def )
+{
+ YPushButton::setDefaultButton( def );
- if ( _dialog->defaultButton() == this )
- _dialog->setDefaultButton(0);
+ if ( ! _setDefaultButtonRecursive )
+ {
+ _setDefaultButtonRecursive = true;
+
+ if ( _dialog && def )
+ dialog()->setDefaultButton( this );
+
+ _setDefaultButtonRecursive = true;
+ }
}
@@ -83,7 +115,7 @@
}
-void YQGenericButton::setIcon( const std::string & iconName )
+void YQGenericButton::setIcon( const string & iconName )
{
if ( ! _qPushButton )
{
@@ -120,7 +152,7 @@
}
-void YQGenericButton::setLabel( const std::string & label )
+void YQGenericButton::setLabel( const string & label )
{
if ( _qPushButton )
_qPushButton->setText( fromUTF8( label ) );
@@ -167,12 +199,12 @@
{
if ( event->type() == QEvent::FocusIn )
{
- _dialog->gettingFocus( this );
+ dialog()->gettingFocus( this );
return false; // event processed?
}
else if ( event->type() == QEvent::FocusOut )
{
- _dialog->losingFocus( this );
+ dialog()->losingFocus( this );
return false; // event processed?
}
else if ( event->type() == QEvent::MouseButtonRelease )
@@ -197,7 +229,7 @@
if ( ! _qPushButton )
return false;
- _dialog->gettingFocus( this );
+ dialog()->gettingFocus( this );
_qPushButton->setFocus();
return true;
Modified: branches/tmp/sh/mod-ui/qt/src/YQGenericButton.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQGenericButton.h?rev=38511&r1=38510&r2=38511&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQGenericButton.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQGenericButton.h Mon Jun 18 17:26:33 2007
@@ -16,7 +16,6 @@
/-*/
-// -*- c++ -*-
#ifndef YQGenericButton_h
#define YQGenericButton_h
@@ -30,6 +29,8 @@
class QObject;
class YQDialog;
+using std::string;
+
/**
* Abstract base class for push button and similar widgets -
* all that can become a YQDialog's "default button".
@@ -43,10 +44,8 @@
/**
* Constructor.
*/
- YQGenericButton( QWidget * parent,
- YQDialog * dialog,
- const YWidgetOpt & opt,
- const std::string & label );
+ YQGenericButton( YWidget * parent,
+ const string & label );
public:
@@ -77,7 +76,7 @@
*
* Reimplemented from YWidget.
*/
- void setLabel( const std::string & label );
+ void setLabel( const string & label );
/**
* Show this button as the dialog's default button. The button never calls
@@ -90,21 +89,16 @@
* mean that this really is the dialogs's default button or it is the
* dialog's focus button (a button that currently has the keyboard focus).
*
- * Don't confuse this with isDefault()!
+ * Don't confuse this with YPushButton::isDefaultButton()!
**/
bool isShownAsDefault() const;
/**
- * Returns 'true' if this is the dialog's default button.
- *
- * Don't confuse this with isShownAsDefault()!
- **/
- bool isDefault() const { return _isDefault; }
-
- /**
* Set this button's default button state.
+ *
+ * Reimplemented from YPushButton.
**/
- void setDefault( bool def = true ) { _isDefault = def; }
+ virtual void setDefaultButton( bool def = true );
/**
* Accept the keyboard focus.
@@ -116,7 +110,7 @@
*
* Reimplemented from YPushButton.
**/
- virtual void setIcon( const std::string & iconName );
+ virtual void setIcon( const string & iconName );
/**
* Returns the button's text ( label ) - useful for log messages etc.
@@ -156,6 +150,12 @@
**/
bool eventFilter( QObject * obj, QEvent * event );
+ /**
+ * Returns the corresponding YQDialog.
+ * Throws an exception if there is none.
+ **/
+ YQDialog * dialog();
+
private:
@@ -163,7 +163,7 @@
YQDialog * _dialog;
QPushButton * _qPushButton;
- bool _isDefault;
+ bool _setDefaultButtonRecursive;
};
#endif // YQGenericButton_h
Modified: branches/tmp/sh/mod-ui/qt/src/YQPushButton.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQPushButton.cc?rev=38511&r1=38510&r2=38511&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQPushButton.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQPushButton.cc Mon Jun 18 17:26:33 2007
@@ -28,11 +28,9 @@
#include "YQPushButton.h"
-YQPushButton::YQPushButton( QWidget * parent,
- YQDialog * dialog,
- const YWidgetOpt & opt,
+YQPushButton::YQPushButton( YWidget * parent,
const std::string & label )
- : YQGenericButton( parent, dialog, opt, label )
+ : YQGenericButton( parent, label )
{
setWidgetRep( this );
Modified: branches/tmp/sh/mod-ui/qt/src/YQPushButton.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQPushButton.h?rev=38511&r1=38510&r2=38511&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQPushButton.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQPushButton.h Mon Jun 18 17:26:33 2007
@@ -16,7 +16,6 @@
/-*/
-// -*- c++ -*-
#ifndef YQPushButton_h
#define YQPushButton_h
@@ -35,10 +34,8 @@
public:
/**
* Constructor.
- */
- YQPushButton( QWidget * parent,
- YQDialog * dialog,
- const YWidgetOpt & opt,
+ **/
+ YQPushButton( YWidget * parent,
const std::string & label );
/**
@@ -48,15 +45,16 @@
/**
* Preferred size of the widget.
+ *
* Reimplemented from YWidget.
- * @dim Dimension, either YD_HORIZ or YD_VERT
*/
long nicesize( YUIDimension dim );
/**
* Sets the new size of the widget.
+ *
* Reimplemented from YWidget.
- */
+ **/
void setSize( long newWidth, long newHeight );
@@ -65,7 +63,7 @@
/**
* Triggered when the button is activated (clicked or via keyboard).
* Notifies the the ui about this.
- */
+ **/
void hit();
};
Modified: branches/tmp/sh/mod-ui/qt/src/YQUI.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQUI.h?rev=38511&r1=38510&r2=38511&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQUI.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQUI.h Mon Jun 18 17:26:33 2007
@@ -455,7 +455,6 @@
YWidget * createMultiLineEdit ( YWidget * parent, YWidgetOpt & opt, const YCPString & label, const YCPString & text);
YWidget * createProgressBar ( YWidget * parent, YWidgetOpt & opt, const YCPString & label, const YCPInteger & maxProgress, const YCPInteger & currentProgress );
YWidget * createPackageSelector ( YWidget * parent, YWidgetOpt & opt, const YCPString & floppyDevice );
- YWidget * createPushButton ( YWidget * parent, YWidgetOpt & opt, const std::string & label);
YWidget * createMenuButton ( YWidget * parent, YWidgetOpt & opt, const YCPString & label);
YWidget * createRichText ( YWidget * parent, YWidgetOpt & opt, const YCPString & text);
YWidget * createSelectionBox ( YWidget * parent, YWidgetOpt & opt, const YCPString & label);
Modified: branches/tmp/sh/mod-ui/qt/src/YQUI_widgets.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQUI_widgets.cc?rev=38511&r1=38510&r2=38511&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQUI_widgets.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQUI_widgets.cc Mon Jun 18 17:26:33 2007
@@ -21,7 +21,6 @@
#include "YQUI.h"
-#include "YQAlignment.h"
#include "YQBarGraph.h"
#include "YQCheckBox.h"
#include "YQCheckBoxFrame.h"
@@ -47,15 +46,11 @@
#include "YQPatternSelector.h"
#include "YQSimplePatchSelector.h"
#include "YQProgressBar.h"
-#include "YQPushButton.h"
-#include "YQRadioButton.h"
#include "YQRadioButtonGroup.h"
-#include "YQReplacePoint.h"
#include "YQRichText.h"
#include "YQSelectionBox.h"
#include "YQSlider.h"
#include "YQSpacing.h"
-#include "YQLayoutBox.h"
#include "YQSquash.h"
#include "YQTable.h"
#include "YQTextEntry.h"
@@ -203,14 +198,6 @@
}
-YWidget * YQUI::createPushButton ( YWidget * parent,
- YWidgetOpt & opt,
- const std::string & label )
-{
- YQDialog * dialog = dynamic_cast ( parent->findDialog() );
- return new YQPushButton( (QWidget *) ( parent->widgetRep() ), dialog, opt, label);
-}
-
YWidget * YQUI::createMenuButton ( YWidget * parent,
YWidgetOpt & opt,
const YCPString & label )
Modified: branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.cc?rev=38511&r1=38510&r2=38511&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.cc Mon Jun 18 17:26:33 2007
@@ -83,7 +83,10 @@
YQPushButton *
YQWidgetFactory::createPushButton( YWidget * parent, const string & label )
{
- return 0; // FIXME: TO DO
+ YQPushButton * pushButton = new YQPushButton( parent, label );
+ YUI_CHECK_NEW( pushButton );
+
+ return pushButton;
}
@@ -224,14 +227,6 @@
-YQPushButton *
-YQWidgetFactory::createIconButton( YWidget * parent, const string & iconName, const string & fallbackTextLabel )
-{
- return 0; // FIXME: TO DO
-}
-
-
-
YQMultiLineEdit *
YQWidgetFactory::createMultiLineEdit( YWidget * parent, const string & label )
{
Modified: branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.h?rev=38511&r1=38510&r2=38511&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.h Mon Jun 18 17:26:33 2007
@@ -109,7 +109,6 @@
virtual YQLabel * createOutputField ( YWidget * parent, const string & label );
virtual YQMenuButton * createMenuButton ( YWidget * parent, const string & label );
- virtual YQPushButton * createIconButton ( YWidget * parent, const string & iconName, const string & fallbackTextLabel );
virtual YQMultiLineEdit * createMultiLineEdit ( YWidget * parent, const string & label );
virtual YQImage * createImage ( YWidget * parent, const string & imagePath );
virtual YQLogView * createLogView ( YWidget * parent, const string & label, int visibleLines, int storedLines = 0 );
Modified: branches/tmp/sh/mod-ui/qt/src/YQWizard.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQWizard.cc?rev=38511&r1=38510&r2=38511&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQWizard.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQWizard.cc Mon Jun 18 17:26:33 2007
@@ -203,7 +203,7 @@
layoutTitleBar( this );
#else
QWidget * spacer = addVSpacing( this, WORK_AREA_TOP_MARGIN );
- CHECK_PTR( spacer );
+ YUI_CHECK_NEW( spacer );
# if ENABLE_GRADIENTS
spacer->setPaletteBackgroundColor( _gradientCenterColor );
@@ -212,7 +212,7 @@
}
QHBox * hBox = new QHBox( this );
- CHECK_PTR( hBox );
+ YUI_CHECK_NEW( hBox );
if ( ! runningEmbedded() )
layoutSideBar( hBox );
@@ -243,7 +243,7 @@
QHBox * titleBar = new QHBox( parent );
- CHECK_PTR( titleBar );
+ YUI_CHECK_NEW( titleBar );
#if ENABLE_GRADIENTS
setGradient( titleBar, _titleBarGradientPixmap );
@@ -280,7 +280,7 @@
//
QLabel * right = new QLabel( titleBar );
- CHECK_PTR( right );
+ YUI_CHECK_NEW( right );
QPixmap rightLogo( PIXMAP_DIR "title-bar-right.png" );
@@ -297,7 +297,7 @@
void YQWizard::layoutSideBar( QWidget * parent )
{
_sideBar = new QWidgetStack( parent );
- CHECK_PTR( _sideBar );
+ YUI_CHECK_NEW( _sideBar );
_sideBar->setMinimumWidth( YQUI::ui()->defaultSize( YD_HORIZ ) / 5 );
_sideBar->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Preferred ) ); // hor/vert
_sideBar->setMargin( 0 );
@@ -322,7 +322,7 @@
void YQWizard::layoutStepsPanel()
{
_stepsPanel = new QVBox( _sideBar );
- CHECK_PTR( _stepsPanel );
+ YUI_CHECK_NEW( _stepsPanel );
#if ENABLE_GRADIENTS
@@ -331,7 +331,7 @@
// Top gradient
QLabel * topGradient = new QLabel( _stepsPanel );
- CHECK_PTR( topGradient );
+ YUI_CHECK_NEW( topGradient );
setGradient( topGradient, _topGradientPixmap );
# endif
@@ -343,14 +343,14 @@
_sideBar->addWidget( _stepsPanel );
_stepsBox = new QVBox( _stepsPanel );
- CHECK_PTR( _stepsBox );
+ YUI_CHECK_NEW( _stepsBox );
#if ENABLE_GRADIENTS
_stepsBox->setPaletteBackgroundColor( _gradientCenterColor );
#endif
_stepsBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred ) ); // hor/vert
QWidget * stretch = addVStretch( _stepsPanel );
- CHECK_PTR( stretch );
+ YUI_CHECK_NEW( stretch );
#if ENABLE_GRADIENTS
stretch->setPaletteBackgroundColor( _gradientCenterColor );
#endif
@@ -361,7 +361,7 @@
QLabel * helpButtonBox = new QLabel( _stepsPanel );
#if ENABLE_GRADIENTS
- CHECK_PTR( helpButtonBox );
+ YUI_CHECK_NEW( helpButtonBox );
setGradient( helpButtonBox, _bottomGradientPixmap );
#endif
@@ -370,7 +370,7 @@
// Layouts for the buttons
QVBoxLayout * vbox = new QVBoxLayout( helpButtonBox, 0, 0 ); // parent, margin, spacing
- CHECK_PTR( vbox );
+ YUI_CHECK_NEW( vbox );
vbox->addStretch( 99 );
@@ -394,7 +394,7 @@
// Help button - intentionally without keyboard shortcut
_helpButton = new QPushButton( _( "Help" ), helpButtonBox );
- CHECK_PTR( _helpButton );
+ YUI_CHECK_NEW( _helpButton );
hbox->addWidget( _helpButton );
hbox->addStretch( 99 );
@@ -476,7 +476,7 @@
//
QWidget * stepsParent = new QWidget( _stepsBox );
- CHECK_PTR( stepsParent );
+ YUI_CHECK_NEW( stepsParent );
stepsParent->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) ); // hor/vert
#if ENABLE_GRADIENTS
stepsParent->setPaletteBackgroundColor( _gradientCenterColor );
@@ -487,7 +487,7 @@
_stepsGrid = new QGridLayout( stepsParent, // parent
_stepsList.count(), 4, // rows, cols
0, STEPS_SPACING ); // margin, spacing
- CHECK_PTR( _stepsGrid );
+ YUI_CHECK_NEW( _stepsGrid );
const int statusCol = 1;
const int nameCol = 2;
@@ -508,11 +508,11 @@
int row = 0;
QWidget * leftSpacer = addHSpacing( stepsParent, STEPS_MARGIN );
- CHECK_PTR( leftSpacer );
+ YUI_CHECK_NEW( leftSpacer );
_stepsGrid->addWidget( leftSpacer, row, 0 );
QWidget * rightSpacer = addHSpacing( stepsParent, STEPS_MARGIN );
- CHECK_PTR( rightSpacer );
+ YUI_CHECK_NEW( rightSpacer );
_stepsGrid->addWidget( rightSpacer, row, 3 );
@@ -531,7 +531,7 @@
// Spacing
QWidget * spacer = addVSpacing( stepsParent, STEPS_HEADING_SPACING );
- CHECK_PTR( spacer );
+ YUI_CHECK_NEW( spacer );
_stepsGrid->addWidget( spacer, row++, nameCol );
}
@@ -540,7 +540,7 @@
//
QLabel * label = new QLabel( step->name(), stepsParent );
- CHECK_PTR( label );
+ YUI_CHECK_NEW( label );
label->setAlignment( Qt::AlignLeft | Qt::AlignTop );
#if USE_FIXED_STEP_FONTS
@@ -571,7 +571,7 @@
//
QLabel * statusLabel = new QLabel( stepsParent );
- CHECK_PTR( statusLabel );
+ YUI_CHECK_NEW( statusLabel );
step->setStatusLabel( statusLabel );
_stepsGrid->addWidget( statusLabel, row, statusCol );
@@ -582,7 +582,7 @@
//
QLabel * nameLabel = new QLabel( step->name(), stepsParent );
- CHECK_PTR( nameLabel );
+ YUI_CHECK_NEW( nameLabel );
nameLabel->setAlignment( Qt::AlignLeft | Qt::AlignTop );
#if USE_FIXED_STEP_FONTS
@@ -686,19 +686,19 @@
void YQWizard::layoutHelpPanel()
{
_helpPanel = new QHBox( _sideBar );
- CHECK_PTR( _helpPanel );
+ YUI_CHECK_NEW( _helpPanel );
_sideBar->addWidget( _helpPanel );
addGradientColumn( _helpPanel );
QVBox * vbox = new QVBox( _helpPanel );
- CHECK_PTR( vbox );
+ YUI_CHECK_NEW( vbox );
// Help browser
_helpBrowser = new QTextBrowser( vbox );
- CHECK_PTR( _helpBrowser );
+ YUI_CHECK_NEW( _helpBrowser );
_helpBrowser->setMimeSourceFactory( 0 );
_helpBrowser->setFont( YQUI::ui()->currentFont() );
@@ -725,7 +725,7 @@
QLabel * buttonBox = new QLabel( vbox );
- CHECK_PTR( buttonBox );
+ YUI_CHECK_NEW( buttonBox );
QPushButton * button;
QPixmap pixmap;
@@ -734,7 +734,7 @@
{
// "Tree" button - intentionally without keyboard shortcut
button = new QPushButton( _( "Tree" ), buttonBox );
- CHECK_PTR( button );
+ YUI_CHECK_NEW( button );
_treeButton = button;
#if USE_ICON_ON_HELP_BUTTON
@@ -746,7 +746,7 @@
{
// "Steps" button - intentionally without keyboard shortcut
button = new QPushButton( _( "Steps" ), buttonBox );
- CHECK_PTR( button );
+ YUI_CHECK_NEW( button );
_stepsButton = button;
#if USE_ICON_ON_HELP_BUTTON
@@ -757,7 +757,7 @@
{
// Create a dummy button just to find out how high it would become
button = new QPushButton( "Dummy", buttonBox );
- CHECK_PTR( button );
+ YUI_CHECK_NEW( button );
}
@@ -790,11 +790,11 @@
void YQWizard::layoutSideBarButtonBox( QWidget * parent, QPushButton * button )
{
QVBoxLayout * vbox = new QVBoxLayout( parent, 0, 0 ); // parent, margin, spacing
- CHECK_PTR( vbox );
+ YUI_CHECK_NEW( vbox );
vbox->addSpacing( BUTTON_BOX_TOP_MARGIN );
QHBoxLayout * hbox = new QHBoxLayout( vbox, 0 ); // parent, spacing
- CHECK_PTR( hbox );
+ YUI_CHECK_NEW( hbox );
hbox->addStretch( 99 );
hbox->addWidget( button );
@@ -819,20 +819,20 @@
void YQWizard::layoutTreePanel()
{
_treePanel = new QHBox( _sideBar );
- CHECK_PTR( _treePanel );
+ YUI_CHECK_NEW( _treePanel );
_sideBar->addWidget( _treePanel );
// Left margin (with gradients)
addGradientColumn( _treePanel );
QVBox * vbox = new QVBox( _treePanel );
- CHECK_PTR( vbox );
+ YUI_CHECK_NEW( vbox );
// Selection tree
_tree = new QY2ListView( vbox );
- CHECK_PTR( _tree );
+ YUI_CHECK_NEW( _tree );
_tree->addColumn( "" );
_tree->header()->hide();
_tree->setRootIsDecorated( true );
@@ -850,12 +850,12 @@
// Bottom gradient
QLabel * buttonBox = new QLabel( vbox );
- CHECK_PTR( buttonBox );
+ YUI_CHECK_NEW( buttonBox );
// "Help" button - intentionally without keyboard shortcut
QPushButton * button = new QPushButton( _( "Help" ), buttonBox );
- CHECK_PTR( button );
+ YUI_CHECK_NEW( button );
#if USE_ICON_ON_HELP_BUTTON
QPixmap pixmap( PIXMAP_DIR "help-button.png" );
@@ -895,12 +895,12 @@
if ( parent )
{
item = new YQWizard::TreeItem( parent, text, id );
- CHECK_PTR( item );
+ YUI_CHECK_NEW( item );
}
else
{
item = new YQWizard::TreeItem( _tree, text, id );
- CHECK_PTR( item );
+ YUI_CHECK_NEW( item );
}
if ( ! id.isEmpty() )
@@ -988,12 +988,12 @@
void YQWizard::layoutWorkArea( QHBox * parentHBox )
{
QVBox * workAreaVBox = new QVBox( parentHBox );
- CHECK_PTR( workAreaVBox );
+ YUI_CHECK_NEW( workAreaVBox );
// An extra QVBox inside the workAreaVBox is needed for frame and margin
QVBox * workArea = new QVBox( workAreaVBox );
- CHECK_PTR( workArea );
+ YUI_CHECK_NEW( workArea );
#if ENABLE_GRADIENTS
workArea->setFrameStyle( QFrame::Box | QFrame::Plain );
@@ -1011,10 +1011,10 @@
// Placed directly inside workArea the menu bar positions itself at (0,0)
// and so obscures any kind of frame there might be.
_menuBarBox = new QVBox( workArea );
- CHECK_PTR( _menuBarBox );
+ YUI_CHECK_NEW( _menuBarBox );
_menuBar = new QMenuBar( _menuBarBox );
- CHECK_PTR( _menuBar );
+ YUI_CHECK_NEW( _menuBar );
_menuBarBox->hide(); // will be made visible when menus are added
@@ -1024,19 +1024,19 @@
//
QHBox * headingHBox = new QHBox( workArea );
- CHECK_PTR( headingHBox );
+ YUI_CHECK_NEW( headingHBox );
headingHBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ) ); // hor/vert
addHSpacing( headingHBox, SEPARATOR_MARGIN );
_dialogIcon = new QLabel( headingHBox );
- CHECK_PTR( _dialogIcon );
+ YUI_CHECK_NEW( _dialogIcon );
_dialogIcon->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ) ); // hor/vert
addHSpacing( headingHBox );
_dialogHeading = new QLabel( headingHBox );
- CHECK_PTR( _dialogHeading );
+ YUI_CHECK_NEW( _dialogHeading );
_dialogHeading->setFont( YQUI::ui()->headingFont() );
_dialogHeading->setAlignment( Qt::AlignLeft | Qt::WordBreak );
_dialogHeading->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ) ); // hor/vert
@@ -1053,7 +1053,7 @@
addHSpacing( hbox, SEPARATOR_MARGIN );
QFrame * separator = new QFrame( hbox );
- CHECK_PTR( separator );
+ YUI_CHECK_NEW( separator );
separator->setFrameStyle( QFrame::HLine | QFrame::Sunken );
addHSpacing( hbox, SEPARATOR_MARGIN );
@@ -1089,7 +1089,7 @@
void YQWizard::layoutClientArea( QWidget * parent )
{
_clientArea = new QVBox( parent );
- CHECK_PTR( _clientArea );
+ YUI_CHECK_NEW( _clientArea );
_clientArea->setMargin( 4 );
#if 0
@@ -1138,10 +1138,7 @@
//
QWidget * buttonBox = new QWidget( parent );
- CHECK_PTR( buttonBox );
-
- YQDialog * dialog = dynamic_cast( YQUI::ui()->currentDialog() );
- CHECK_PTR( dialog );
+ YUI_CHECK_NEW( buttonBox );
// Using old-style layouts to enable a seamless background with the
// gradient pixmap: Any sub-widgets (QVBox, QHBox) would have to get yet
@@ -1149,7 +1146,7 @@
// be very hard to cover all cases - resizing, hiding individual buttons, etc.
QVBoxLayout * vbox = new QVBoxLayout( buttonBox, 0, 0 ); // parent, margin, spacing
- CHECK_PTR( vbox );
+ YUI_CHECK_NEW( vbox );
vbox->addSpacing( BUTTON_BOX_TOP_MARGIN );
@@ -1159,15 +1156,15 @@
//
QHBoxLayout * hbox = new QHBoxLayout( vbox, 2 ); // parent, spacing
- CHECK_PTR( hbox );
+ YUI_CHECK_NEW( hbox );
//
// "Back" button
//
- _backButton = new YQWizardButton( this, dialog, buttonBox, _backButtonLabel->value(), _backButtonId );
- CHECK_PTR( _backButton );
+ _backButton = new YQWizardButton( this, buttonBox, _backButtonLabel->value(), _backButtonId );
+ YUI_CHECK_NEW( _backButton );
hbox->addWidget( (QWidget *) _backButton->widgetRep() );
addChild( _backButton ); // Enable shortcut checking for this button
@@ -1177,7 +1174,7 @@
_backButtonSpacer = new QSpacerItem( 0, 0, // width, height
QSizePolicy::Expanding, // horizontal
QSizePolicy::Minimum ); // vertical
- CHECK_PTR( _backButtonSpacer );
+ YUI_CHECK_NEW( _backButtonSpacer );
hbox->addItem( _backButtonSpacer );
@@ -1196,8 +1193,8 @@
// "Abort" button
//
- _abortButton = new YQWizardButton( this, dialog, buttonBox, _abortButtonLabel->value(), _abortButtonId );
- CHECK_PTR( _abortButton );
+ _abortButton = new YQWizardButton( this, buttonBox, _abortButtonLabel->value(), _abortButtonId );
+ YUI_CHECK_NEW( _abortButton );
hbox->addWidget( (QWidget *) _abortButton->widgetRep() );
addChild( _abortButton ); // Enable shortcut checking for this button
@@ -1212,7 +1209,7 @@
QSpacerItem * spacer = new QSpacerItem( 0, 0, // width, height
QSizePolicy::Expanding, // horizontal
QSizePolicy::Minimum ); // vertical
- CHECK_PTR( spacer );
+ YUI_CHECK_NEW( spacer );
hbox->addItem( spacer );
@@ -1220,8 +1217,8 @@
// "Next" button
//
- _nextButton = new YQWizardButton( this, dialog, buttonBox, _nextButtonLabel->value(), _nextButtonId );
- CHECK_PTR( _nextButton );
+ _nextButton = new YQWizardButton( this, buttonBox, _nextButtonLabel->value(), _nextButtonId );
+ YUI_CHECK_NEW( _nextButton );
hbox->addWidget( (QWidget *) _nextButton->widgetRep() );
addChild( _nextButton ); // Enable shortcut checking for this button
@@ -1367,20 +1364,20 @@
return;
QVBox * vbox = new QVBox( parent );
- CHECK_PTR( vbox );
+ YUI_CHECK_NEW( vbox );
#if ENABLE_GRADIENTS
QWidget * topGradient = addHSpacing( vbox, width );
- CHECK_PTR( topGradient );
+ YUI_CHECK_NEW( topGradient );
setGradient( topGradient, _topGradientPixmap );
QWidget * centerStretch = new QWidget( vbox );
- CHECK_PTR( centerStretch );
+ YUI_CHECK_NEW( centerStretch );
centerStretch->setPaletteBackgroundColor( _gradientCenterColor );
QWidget * bottomGradient = new QWidget( vbox );
- CHECK_PTR( bottomGradient );
+ YUI_CHECK_NEW( bottomGradient );
setGradient( bottomGradient, _bottomGradientPixmap );
#else
vbox->setFixedWidth( width );
@@ -1510,6 +1507,7 @@
void YQWizard::addChild( YWidget * child )
{
+#if 0
if ( dynamic_cast (child)
|| _contents == 0 )
{
@@ -1519,6 +1517,15 @@
{
YUI_THROW( YUITooManyChildrenException<YWidget>( this ) );
}
+#else
+ // FIXME
+ // FIXME
+ // FIXME
+ YWidget::addChild( child );
+ // FIXME
+ // FIXME
+ // FIXME
+#endif
}
@@ -1598,7 +1605,7 @@
if ( _menuBar )
{
QPopupMenu * menu = new QPopupMenu( _menuBar );
- CHECK_PTR( menu );
+ YUI_CHECK_NEW( menu );
_menuIDs.insert( id, menu );
_menuBar->insertItem( text, menu );
@@ -1624,7 +1631,7 @@
if ( parentMenu )
{
QPopupMenu * menu = new QPopupMenu( _menuBar );
- CHECK_PTR( menu );
+ YUI_CHECK_NEW( menu );
_menuIDs.insert( id, menu );
parentMenu->insertItem( text, menu );
Modified: branches/tmp/sh/mod-ui/qt/src/YQWizardButton.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQWizardButton.cc?rev=38511&r1=38510&r2=38511&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQWizardButton.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQWizardButton.cc Mon Jun 18 17:26:33 2007
@@ -29,11 +29,10 @@
YQWizardButton::YQWizardButton( YQWizard * wizard,
- YQDialog * dialog,
QWidget * buttonParent,
const std::string & label,
const YCPValue & id )
- : YQGenericButton( wizard, dialog, YWidgetOpt(), label )
+ : YQGenericButton( wizard, label )
, _wizard( wizard )
{
QPushButton * button = new QPushButton( fromUTF8( label ), buttonParent );
@@ -44,11 +43,6 @@
setId( id );
button->setFont( YQUI::ui()->currentFont() );
- // The parent dialog makes a wizard button the default button if the rest
- // of the dialog doesn't have a default button, so make sure this button
- // doesn't interfere with that.
- setDefault( false );
-
connect( button, SIGNAL( clicked() ),
this, SIGNAL( clicked() ) );
Modified: branches/tmp/sh/mod-ui/qt/src/YQWizardButton.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQWizardButton.h?rev=38511&r1=38510&r2=38511&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQWizardButton.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQWizardButton.h Mon Jun 18 17:26:33 2007
@@ -16,7 +16,6 @@
/-*/
-// -*- c++ -*-
#ifndef YQWizardButton_h
#define YQWizardButton_h
@@ -39,7 +38,6 @@
* Constructor.
*/
YQWizardButton( YQWizard * wizard,
- YQDialog * dialog,
QWidget * buttonParent,
const std::string & label,
const YCPValue & id );
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org