Author: sh-sh-sh
Date: Fri Jun 1 18:38:26 2007
New Revision: 38257
URL: http://svn.opensuse.org/viewcvs/yast?rev=38257&view=rev
Log:
ported PushButton
Modified:
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/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/YQGenericButton.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQGenericButton.cc?rev=38257&r1=38256&r2=38257&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQGenericButton.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQGenericButton.cc Fri Jun 1 18:38:26 2007
@@ -33,13 +33,13 @@
YQGenericButton::YQGenericButton( QWidget * parent,
YQDialog * dialog,
const YWidgetOpt & opt,
- YCPString label )
+ const std::string & label )
: QWidget( parent )
, YPushButton( opt, label )
, _dialog( dialog )
{
setWidgetRep( 0 );
-
+
_isDefault = opt.isDefaultButton.value();
}
@@ -62,7 +62,7 @@
{
if ( _dialog->focusButton() == this )
_dialog->losingFocus( this );
-
+
if ( _dialog->defaultButton() == this )
_dialog->setDefaultButton(0);
}
@@ -72,7 +72,7 @@
{
if ( _qPushButton )
_qPushButton->setEnabled( enabled );
-
+
YWidget::setEnabling( enabled );
}
@@ -83,27 +83,27 @@
}
-void YQGenericButton::setIcon( const YCPString & y_icon_name )
+void YQGenericButton::setIcon( const std::string & iconName )
{
if ( ! _qPushButton )
{
- y2error( "NULL button (icon %s)", y_icon_name->value().c_str() );
+ y2error( "NULL button (icon %s)", iconName.c_str() );
return;
}
-
- QString icon_name = fromUTF8( y_icon_name->value() );
- if ( icon_name.isEmpty() )
+ QString qIconName = fromUTF8( iconName );
+
+ if ( qIconName.isEmpty() )
{
_qPushButton->setIconSet( QIconSet() );
return;
}
- icon_name = QString( ICONDIR ) + "/" + icon_name;
- QPixmap icon( icon_name );
+ qIconName = QString( ICONDIR ) + "/" + qIconName;
+ QPixmap icon( qIconName );
if ( icon.isNull() )
- y2warning( "Can't load icon '%s'", (const char *) icon_name );
+ y2warning( "Can't load icon '%s'", (const char *) qIconName );
else
_qPushButton->setIconSet( icon );
}
@@ -115,18 +115,18 @@
_qPushButton->setText( label );
else
y2error( "NULL button '%s'", (const char *) label );
-
+
YPushButton::setLabel( toUTF8( label ) );
}
-void YQGenericButton::setLabel( const YCPString & label )
+void YQGenericButton::setLabel( const std::string & label )
{
if ( _qPushButton )
- _qPushButton->setText( fromUTF8( label->value() ) );
+ _qPushButton->setText( fromUTF8( label ) );
else
- y2error( "NULL button '%s'", label->value().c_str() );
-
+ y2error( "NULL button '%s'", label.c_str() );
+
YPushButton::setLabel( label );
}
@@ -186,8 +186,8 @@
}
}
}
-
-
+
+
return QObject::eventFilter( obj, event );
}
@@ -196,7 +196,7 @@
{
if ( ! _qPushButton )
return false;
-
+
_dialog->gettingFocus( this );
_qPushButton->setFocus();
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=38257&r1=38256&r2=38257&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQGenericButton.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQGenericButton.h Fri Jun 1 18:38:26 2007
@@ -22,7 +22,6 @@
#define YQGenericButton_h
#include
-#include
#include "YPushButton.h"
@@ -47,7 +46,7 @@
YQGenericButton( QWidget * parent,
YQDialog * dialog,
const YWidgetOpt & opt,
- YCPString label );
+ const std::string & label );
public:
@@ -57,11 +56,12 @@
virtual ~YQGenericButton();
/**
- * Inherited from YWidget: Sets the enabled state of the
- * widget. Only enabled widgets can take user input.
- */
+ * Set enabled/disabled status.
+ *
+ * Reimplemented from YWidget.
+ **/
void setEnabling( bool enabled );
-
+
/**
* Returns 'true' if this button is enabled, 'false' otherwise.
**/
@@ -74,8 +74,10 @@
/**
* Changes the label (the text) of the button.
+ *
+ * Reimplemented from YWidget.
*/
- void setLabel( const YCPString & label );
+ void setLabel( const std::string & label );
/**
* Show this button as the dialog's default button. The button never calls
@@ -111,9 +113,10 @@
/**
* Set this button's icon.
- * Inherited from YPushButton.
+ *
+ * Reimplemented from YPushButton.
**/
- virtual void setIcon( const YCPString & icon_name );
+ virtual void setIcon( const std::string & iconName );
/**
* Returns the button's text ( label ) - useful for log messages etc.
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=38257&r1=38256&r2=38257&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQPushButton.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQPushButton.cc Fri Jun 1 18:38:26 2007
@@ -31,12 +31,12 @@
YQPushButton::YQPushButton( QWidget * parent,
YQDialog * dialog,
const YWidgetOpt & opt,
- const YCPString & label )
+ const std::string & label )
: YQGenericButton( parent, dialog, opt, label )
{
setWidgetRep( this );
- QPushButton * button = new QPushButton( fromUTF8( label->value() ), this );
+ QPushButton * button = new QPushButton( fromUTF8( label ), this );
CHECK_PTR( button );
setQPushButton( button );
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=38257&r1=38256&r2=38257&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQPushButton.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQPushButton.h Fri Jun 1 18:38:26 2007
@@ -39,7 +39,7 @@
YQPushButton( QWidget * parent,
YQDialog * dialog,
const YWidgetOpt & opt,
- const YCPString & label );
+ const std::string & label );
/**
* Destructor.
@@ -63,8 +63,8 @@
public slots:
/**
- * Triggered when the button is activated ( clicked or via keyboard ). Informs
- * the ui about this.
+ * 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=38257&r1=38256&r2=38257&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQUI.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQUI.h Fri Jun 1 18:38:26 2007
@@ -436,7 +436,7 @@
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 YCPString & label);
+ YWidget * createPushButton ( YWidget * parent, YWidgetOpt & opt, const std::string & label);
YWidget * createMenuButton ( YWidget * parent, YWidgetOpt & opt, const YCPString & label);
YWidget * createRadioButton ( YWidget * parent, YWidgetOpt & opt, YRadioButtonGroup * rbg, const std::string & label, bool checked);
YWidget * createRichText ( YWidget * parent, YWidgetOpt & opt, const YCPString & text);
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=38257&r1=38256&r2=38257&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQUI_widgets.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQUI_widgets.cc Fri Jun 1 18:38:26 2007
@@ -226,7 +226,7 @@
YWidget * YQUI::createPushButton ( YWidget * parent,
YWidgetOpt & opt,
- const YCPString & label )
+ const std::string & label )
{
YQDialog * dialog = dynamic_cast ( parent->yDialog() );
return new YQPushButton( (QWidget *) ( parent->widgetRep() ), dialog, opt, label);
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=38257&r1=38256&r2=38257&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQWizard.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQWizard.cc Fri Jun 1 18:38:26 2007
@@ -1171,7 +1171,7 @@
// "Back" button
//
- _backButton = new YQWizardButton( this, dialog, buttonBox, _backButtonLabel, _backButtonId );
+ _backButton = new YQWizardButton( this, dialog, buttonBox, _backButtonLabel->value(), _backButtonId );
CHECK_PTR( _backButton );
hbox->addWidget( (QWidget *) _backButton->widgetRep() );
@@ -1201,7 +1201,7 @@
// "Abort" button
//
- _abortButton = new YQWizardButton( this, dialog, buttonBox, _abortButtonLabel, _abortButtonId );
+ _abortButton = new YQWizardButton( this, dialog, buttonBox, _abortButtonLabel->value(), _abortButtonId );
CHECK_PTR( _abortButton );
hbox->addWidget( (QWidget *) _abortButton->widgetRep() );
@@ -1225,7 +1225,7 @@
// "Next" button
//
- _nextButton = new YQWizardButton( this, dialog, buttonBox, _nextButtonLabel, _nextButtonId );
+ _nextButton = new YQWizardButton( this, dialog, buttonBox, _nextButtonLabel->value(), _nextButtonId );
CHECK_PTR( _nextButton );
hbox->addWidget( (QWidget *) _nextButton->widgetRep() );
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=38257&r1=38256&r2=38257&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQWizardButton.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQWizardButton.cc Fri Jun 1 18:38:26 2007
@@ -31,12 +31,12 @@
YQWizardButton::YQWizardButton( YQWizard * wizard,
YQDialog * dialog,
QWidget * buttonParent,
- const YCPString & label,
+ const std::string & label,
const YCPValue & id )
: YQGenericButton( wizard, dialog, YWidgetOpt(), label )
, _wizard( wizard )
{
- QPushButton * button = new QPushButton( fromUTF8( label->value() ), buttonParent );
+ QPushButton * button = new QPushButton( fromUTF8( label ), buttonParent );
CHECK_PTR( button );
setQPushButton( button );
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=38257&r1=38256&r2=38257&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQWizardButton.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQWizardButton.h Fri Jun 1 18:38:26 2007
@@ -22,7 +22,6 @@
#define YQWizardButton_h
#include
-#include
#include "YQGenericButton.h"
@@ -42,7 +41,7 @@
YQWizardButton( YQWizard * wizard,
YQDialog * dialog,
QWidget * buttonParent,
- const YCPString & label,
+ const std::string & label,
const YCPValue & id );
/**
@@ -54,7 +53,7 @@
* Returns a descriptive name of this widget class for logging,
* debugging etc.
*/
- virtual char *widgetClass() { return "YQWizardButton"; }
+ virtual const char *widgetClass() { return "YQWizardButton"; }
/**
* Hide the associated QPushButton.
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org