From cfc3668d1fc6256164016c01bb3b727e0fbd6004 Mon Sep 17 00:00:00 2001 From: coolo Date: Wed, 28 Nov 2007 07:43:34 +0000 Subject: [PATCH] merging mod-ui changes from trunk git-svn-id: http://svn.opensuse.org/svn/yast/branches/tmp/coolo/qt4-port@42468 e0cc52ee-31ee-0310-8b87-e83c4596d67c --- VERSION | 2 +- package/yast2-qt4.changes | 6 + src/CMakeLists.txt | 22 +- src/YQGenericButton.h | 4 +- src/YQOptionalWidgetFactory.cc | 16 +- src/YQOptionalWidgetFactory.h | 10 +- src/YQWizard.cc | 457 ++++++++------------------------- src/YQWizard.h | 358 +++++++++++++------------- src/YQWizardButton.cc | 6 +- src/YQWizardButton.h | 4 +- yast2-qt4.spec.in | 3 +- 11 files changed, 326 insertions(+), 562 deletions(-) diff --git a/VERSION b/VERSION index 99e60c0..ffa5fee 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.16.4 +2.16.5 diff --git a/package/yast2-qt4.changes b/package/yast2-qt4.changes index 88f877d..ab2235e 100644 --- a/package/yast2-qt4.changes +++ b/package/yast2-qt4.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Nov 27 19:08:00 CET 2007 - sh@suse.de + +- Moved all YCP related code out of YQWizard +- V 2.16.5 + ------------------------------------------------------------------- Tue Nov 27 11:39:21 CET 2007 - tgoettlicher@suse.de diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4e9c2c8..f818c59 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -14,7 +14,22 @@ ADD_DEFINITIONS( SET( QT_USE_QT3SUPPORT TRUE ) SET(qt4_yast_plugin_SRCS - QY2CharValidator.cc QY2ComboTabWidget.cc QY2DiskUsageList.cc QY2LayoutUtils.cc QY2ListView.cc QY2Settings.cc Y2CCQt.cc YFrameBuffer.cc YQAlignment.cc YQApplication.cc YQBarGraph.cc YQCheckBox.cc YQCheckBoxFrame.cc YQComboBox.cc YQDateField.cc YQDialog.cc YQDownloadProgress.cc YQDumbTab.cc YQEBunny.cc YQEmpty.cc YQFrame.cc YQGenericButton.cc YQIconPool.cc YQImage.cc YQInputField.cc YQIntField.cc YQLabel.cc YQLayoutBox.cc YQLogView.cc YQMenuButton.cc YQMultiLineEdit.cc YQMultiProgressMeter.cc YQMultiSelectionBox.cc YQOptionalWidgetFactory.cc YQPackageSelectorPlugin.cc YQPartitionSplitter.cc YQProgressBar.cc YQPushButton.cc YQRadioButton.cc YQRadioButtonGroup.cc YQReplacePoint.cc YQRichText.cc YQSelectionBox.cc YQSignalBlocker.cc YQSlider.cc YQSpacing.cc YQSquash.cc YQTable.cc YQTimeField.cc YQTree.cc YQUI_builtins.cc YQUI_core.cc YQUI_widgets.cc YQUI_x11.cc YQWidgetCaption.cc YQWidgetFactory.cc YQWizardButton.cc YQWizard.cc + QY2CharValidator.cc QY2ComboTabWidget.cc QY2DiskUsageList.cc + QY2LayoutUtils.cc QY2ListView.cc QY2Settings.cc Y2CCQt.cc + YFrameBuffer.cc YQAlignment.cc YQApplication.cc YQBarGraph.cc + YQCheckBox.cc YQCheckBoxFrame.cc YQComboBox.cc YQDateField.cc + YQDialog.cc YQDownloadProgress.cc YQDumbTab.cc YQEBunny.cc + YQEmpty.cc YQFrame.cc YQGenericButton.cc YQIconPool.cc + YQImage.cc YQInputField.cc YQIntField.cc YQLabel.cc YQLayoutBox.cc + YQLogView.cc YQMenuButton.cc YQMultiLineEdit.cc + YQMultiProgressMeter.cc YQMultiSelectionBox.cc + YQOptionalWidgetFactory.cc YQPackageSelectorPlugin.cc + YQPartitionSplitter.cc YQProgressBar.cc YQPushButton.cc + YQRadioButton.cc YQRadioButtonGroup.cc YQReplacePoint.cc + YQRichText.cc YQSelectionBox.cc YQSignalBlocker.cc YQSlider.cc + YQSpacing.cc YQSquash.cc YQTable.cc YQTimeField.cc YQTree.cc + YQUI_builtins.cc YQUI_core.cc YQUI_widgets.cc YQUI_x11.cc + YQWidgetCaption.cc YQWidgetFactory.cc YQWizardButton.cc YQWizard.cc ) QT4_AUTOMOC(${qt4_yast_plugin_SRCS}) @@ -35,8 +50,7 @@ SET_TARGET_PROPERTIES( py2qt4 PROPERTIES SOVERSION 2 ) INSTALL(TARGETS py2qt4 LIBRARY DESTINATION ${YAST_PLUGIN_DIR} ) -ADD_SUBDIRECTORY(pkg) +# ADD_SUBDIRECTORY(pkg) - -#SET_TARGET_PROPERTIES( y2lang_qt4 PROPERTIES PREFIX "" ) \ No newline at end of file +#SET_TARGET_PROPERTIES( y2lang_qt4 PROPERTIES PREFIX "" ) diff --git a/src/YQGenericButton.h b/src/YQGenericButton.h index 90f7422..edb8d9d 100644 --- a/src/YQGenericButton.h +++ b/src/YQGenericButton.h @@ -76,7 +76,7 @@ public: * * Reimplemented from YWidget. **/ - void setLabel( const string & label ); + virtual void setLabel( const string & label ); /** * Show this button as the dialog's default button. The button never calls @@ -113,7 +113,7 @@ public: virtual void setIcon( const string & iconName ); /** - * Returns the button's text ( label ) - useful for log messages etc. + * Returns the button's text (label) - useful for log messages etc. **/ QString text() const; diff --git a/src/YQOptionalWidgetFactory.cc b/src/YQOptionalWidgetFactory.cc index 59e93a4..4f53f8e 100644 --- a/src/YQOptionalWidgetFactory.cc +++ b/src/YQOptionalWidgetFactory.cc @@ -47,16 +47,16 @@ bool YQOptionalWidgetFactory::hasWizard() } YQWizard * -YQOptionalWidgetFactory::createWizard( YWidget * parent, - YWidgetID * backButtonId, const string & backButtonLabel, - YWidgetID * abortButtonId, const string & abortButtonLabel, - YWidgetID * nextButtonId, const string & nextButtonLabel, - YWizardMode wizardMode ) +YQOptionalWidgetFactory::createWizard( YWidget * parent, + const string & backButtonLabel, + const string & abortButtonLabel, + const string & nextButtonLabel, + YWizardMode wizardMode ) { YQWizard * wizard = new YQWizard( parent, - backButtonId, backButtonLabel, - abortButtonId, abortButtonLabel, - nextButtonId, nextButtonLabel, + backButtonLabel, + abortButtonLabel, + nextButtonLabel, wizardMode ); YUI_CHECK_NEW( wizard ); diff --git a/src/YQOptionalWidgetFactory.h b/src/YQOptionalWidgetFactory.h index 646a979..786bce0 100644 --- a/src/YQOptionalWidgetFactory.h +++ b/src/YQOptionalWidgetFactory.h @@ -56,11 +56,11 @@ public: virtual bool hasWizard(); - virtual YQWizard * createWizard ( YWidget * parent, - YWidgetID * backButtonId, const string & backButtonLabel, - YWidgetID * abortButtonId, const string & abortButtonLabel, - YWidgetID * nextButtonId, const string & nextButtonLabel, - YWizardMode wizardMode = YWizardMode_Standard ); + virtual YQWizard * createWizard ( YWidget * parent, + const string & backButtonLabel, + const string & abortButtonLabel, + const string & nextButtonLabel, + YWizardMode wizardMode = YWizardMode_Standard ); virtual bool hasDumbTab(); virtual YQDumbTab * createDumbTab ( YWidget * parent ); diff --git a/src/YQWizard.cc b/src/YQWizard.cc index 24044be..69af653 100644 --- a/src/YQWizard.cc +++ b/src/YQWizard.cc @@ -22,23 +22,10 @@ #include "YQWizard.h" #define y2log_component "qt-wizard" #include -#include "YCPValueWidgetID.h" // For the command parser #include - -#include -#include -#include -#include "ycp/YCPInteger.h" -#include -#include -#include -#include -#include -#include -#include #include #include @@ -123,17 +110,20 @@ using std::string; #define USE_ICON_ON_HELP_BUTTON 0 -YQWizard::YQWizard( YWidget * parent, - YWidgetID * backButtonId, const string & backButtonLabel, - YWidgetID * abortButtonId, const string & abortButtonLabel, - YWidgetID * nextButtonId, const string & nextButtonLabel, - YWizardMode wizardMode ) +YQWizard::YQWizard( YWidget * parent, + const string & backButtonLabel, + const string & abortButtonLabel, + const string & nextButtonLabel, + YWizardMode wizardMode ) : QFrame( (QWidget *) parent->widgetRep() ) , YWizard( parent, - backButtonId, backButtonLabel, - abortButtonId, abortButtonLabel, - nextButtonId, nextButtonLabel, + backButtonLabel, + abortButtonLabel, + nextButtonLabel, wizardMode ) + , _backButtonLabel( backButtonLabel ) + , _abortButtonLabel( abortButtonLabel ) + , _nextButtonLabel( nextButtonLabel ) { QVBoxLayout* layout = new QVBoxLayout( this ); layout->setSpacing( 0 ); @@ -145,8 +135,6 @@ YQWizard::YQWizard( YWidget * parent, _stepsEnabled = (wizardMode == YWizardMode_Steps); _treeEnabled = (wizardMode == YWizardMode_Tree); - _verboseCommands = false; - _protectNextButton = false; _stepsDirty = false; _direction = YQWizard::Forward; @@ -173,6 +161,7 @@ YQWizard::YQWizard( YWidget * parent, _abortButton = 0; _nextButton = 0; _sendButtonEvents = true; + _contentsReplacePoint = 0; _stepsList.setAutoDelete( true ); _stepsIDs.setAutoDelete( false ); // Only for one of both! @@ -413,14 +402,16 @@ void YQWizard::layoutStepsPanel() -void YQWizard::addStep( const QString & text, const QString & id ) +void YQWizard::addStep( const string & text, const string & id ) { - if ( _stepsIDs[ id ] ) + QString qId = fromUTF8( id ); + + if ( _stepsIDs[ qId ] ) { y2error( "Step ID \"%s\" (\"%s\") already used for \"%s\"", - (const char *) id, - (const char *) text, - (const char *) _stepsIDs[ id ]->name() ); + id.c_str(), + text.c_str(), + (const char *) _stepsIDs[ qId ]->name() ); return; } @@ -432,20 +423,20 @@ void YQWizard::addStep( const QString & text, const QString & id ) // sufficient to check the last step of the list. If the texts are the // same, the other with the same text needs to get another (additional) // ID to make sure setCurrentStep() works as it should. - _stepsList.last()->addID( id ); + _stepsList.last()->addID( qId ); } else { - _stepsList.append( new YQWizard::Step( text, id ) ); + _stepsList.append( new YQWizard::Step( fromUTF8( text ), qId ) ); _stepsDirty = true; } - _stepsIDs.insert( id, _stepsList.last() ); + _stepsIDs.insert( qId, _stepsList.last() ); } -void YQWizard::addStepHeading( const QString & text ) +void YQWizard::addStepHeading( const string & text ) { _stepsList.append( new YQWizard::StepHeading( text ) ); _stepsDirty = true; @@ -658,7 +649,7 @@ void YQWizard::setStepStatus( YQWizard::Step * step, const QPixmap & icon, const } -void YQWizard::setCurrentStep( const QString & id ) +void YQWizard::setCurrentStep( const string & id ) { _currentStepID = id; updateStepStates(); @@ -837,7 +828,7 @@ void YQWizard::layoutTreePanel() _tree = new QY2ListView( vbox ); YUI_CHECK_NEW( _tree ); - + _tree->addColumn( "" ); _tree->header()->hide(); _tree->setRootIsDecorated( true ); @@ -882,8 +873,10 @@ void YQWizard::layoutTreePanel() -void YQWizard::addTreeItem( const QString & parentID, const QString & text, const QString & id ) +void YQWizard::addTreeItem( const string & parentID, const string & text, const string & id ) { + QString qId = fromUTF8( id ); + if ( ! _tree ) { y2error( "YQWizard widget not created with `opt(`treeEnabled) !" ); @@ -893,24 +886,24 @@ void YQWizard::addTreeItem( const QString & parentID, const QString & text, cons YQWizard::TreeItem * item = 0; YQWizard::TreeItem * parent = 0; - if ( ! parentID.isEmpty() ) + if ( ! parentID.empty() ) { parent = findTreeItem( parentID ); } if ( parent ) { - item = new YQWizard::TreeItem( parent, text, id ); + item = new YQWizard::TreeItem( parent, fromUTF8( text ), qId ); YUI_CHECK_NEW( item ); } else { - item = new YQWizard::TreeItem( _tree, text, id ); + item = new YQWizard::TreeItem( _tree, fromUTF8( text ), qId ); YUI_CHECK_NEW( item ); } - if ( ! id.isEmpty() ) - _treeIDs.insert( id, item ); + if ( ! qId.isEmpty() ) + _treeIDs.insert( qId, item ); } @@ -925,16 +918,16 @@ void YQWizard::deleteTreeItems() -YQWizard::TreeItem * YQWizard::findTreeItem( const QString & id ) +YQWizard::TreeItem * YQWizard::findTreeItem( const string & id ) { - if ( id.isEmpty() ) + if ( id.empty() ) return 0; - return _treeIDs[ id ]; + return _treeIDs[ fromUTF8( id ) ]; } -void YQWizard::selectTreeItem( const QString & id ) +void YQWizard::selectTreeItem( const string & id ) { if ( _tree ) { @@ -958,7 +951,7 @@ void YQWizard::sendTreeEvent( Q3ListViewItem * listViewItem ) YQWizard::TreeItem * item = dynamic_cast ( listViewItem ); if ( item && ! item->id().isEmpty() ) - sendEvent( YCPString( toUTF8( item->id() ) ) ); + sendEvent( toUTF8( item->id() ) ); } } @@ -970,7 +963,7 @@ void YQWizard::treeSelectionChanged() } -YCPString YQWizard::currentTreeSelection() +string YQWizard::currentTreeSelection() { if ( _tree ) { @@ -981,16 +974,15 @@ YCPString YQWizard::currentTreeSelection() YQWizard::TreeItem * item = dynamic_cast (sel); if ( item && ! item->id().isEmpty() ) - return YCPString( (const char *) item->id() ); + return toUTF8( item->id() ); } } - return YCPString( "" ); + return string(); } - void YQWizard::layoutWorkArea( QFrame * parentHBox ) { Q3VBox * workAreaVBox = new Q3VBox( parentHBox ); @@ -1117,16 +1109,14 @@ void YQWizard::layoutClientArea( QWidget * parent ) // Replace point for wizard contents // - YReplacePoint * replacePoint = YUI::widgetFactory()->createReplacePoint( _contents ); - replacePoint->setId( new YCPValueWidgetID( YCPSymbol( YWizardContentsReplacePointID ) ) ); // `id(`contents) - + _contentsReplacePoint = YUI::widgetFactory()->createReplacePoint( _contents ); // // Initial YEmpty widget contents of replace point // - YUI::widgetFactory()->createEmpty( replacePoint ); - replacePoint->showChild(); + YUI::widgetFactory()->createEmpty( _contentsReplacePoint ); + _contentsReplacePoint->showChild(); } @@ -1163,7 +1153,7 @@ void YQWizard::layoutButtonBox( QWidget * parent ) // "Back" button // - _backButton = new YQWizardButton( this, buttonBox, backButtonLabel(), backButtonId() ); + _backButton = new YQWizardButton( this, buttonBox, _backButtonLabel ); YUI_CHECK_NEW( _backButton ); hbox->addWidget( (QWidget *) _backButton->widgetRep() ); @@ -1192,7 +1182,7 @@ void YQWizard::layoutButtonBox( QWidget * parent ) // "Abort" button // - _abortButton = new YQWizardButton( this, buttonBox, abortButtonLabel(), abortButtonId() ); + _abortButton = new YQWizardButton( this, buttonBox, _abortButtonLabel ); YUI_CHECK_NEW( _abortButton ); hbox->addWidget( (QWidget *) _abortButton->widgetRep() ); @@ -1215,7 +1205,7 @@ void YQWizard::layoutButtonBox( QWidget * parent ) // "Next" button // - _nextButton = new YQWizardButton( this, buttonBox, nextButtonLabel(), nextButtonId() ); + _nextButton = new YQWizardButton( this, buttonBox, _nextButtonLabel ); YUI_CHECK_NEW( _nextButton ); hbox->addWidget( (QWidget *) _nextButton->widgetRep() ); @@ -1437,16 +1427,16 @@ void YQWizard::disconnectNotify ( const char * signal ) } -void YQWizard::setDialogIcon( const char * iconName ) +void YQWizard::setDialogIcon( const string & iconName ) { if ( _dialogIcon ) { - if ( iconName && *iconName ) + if ( ! iconName.empty() ) { - QPixmap icon( iconName ); + QPixmap icon( iconName.c_str() ); if ( icon.isNull() ) - y2warning( "Couldn't load dialog icon \"%s\"", iconName ); + y2warning( "Couldn't load dialog icon \"%s\"", iconName.c_str() ); else { _dialogIcon->setPixmap( icon ); @@ -1462,12 +1452,12 @@ void YQWizard::setDialogIcon( const char * iconName ) } -void YQWizard::setDialogHeading( const QString & headingText ) +void YQWizard::setDialogHeading( const string & headingText ) { if ( _dialogHeading ) { - if ( ! headingText.isEmpty() ) - _dialogHeading->setText( headingText ); + if ( ! headingText.empty() ) + _dialogHeading->setText( fromUTF8( headingText ) ); else _dialogHeading->clear(); } @@ -1492,14 +1482,15 @@ string YQWizard::debugLabel() return "untitled YQWizard"; } -void YQWizard::setHelpText( QString helpText ) +void YQWizard::setHelpText( const string & helpText ) { if ( _helpBrowser ) { - if ( ! helpText.isEmpty() ) + if ( ! helpText.empty() ) { - helpText.replace( "&product;", YQUI::ui()->productName() ); - _helpBrowser->setText( helpText ); + QString qHelpText = fromUTF8( helpText ); + qHelpText.replace( "&product;", YQUI::ui()->productName() ); + _helpBrowser->setText( qHelpText ); } else _helpBrowser->clear(); @@ -1512,7 +1503,7 @@ void YQWizard::slotBackClicked() emit backClicked(); if ( _sendButtonEvents ) - sendEvent( _backButton->id() ); + YQUI::ui()->sendEvent( new YWidgetEvent( _backButton, YEvent::Activated ) ); _direction = YQWizard::Backward; } @@ -1523,7 +1514,7 @@ void YQWizard::slotAbortClicked() emit abortClicked(); if ( _sendButtonEvents ) - sendEvent( _abortButton->id() ); + YQUI::ui()->sendEvent( new YWidgetEvent( _abortButton, YEvent::Activated ) ); } @@ -1532,7 +1523,7 @@ void YQWizard::slotNextClicked() emit nextClicked(); if ( _sendButtonEvents ) - sendEvent( _nextButton->id() ); + YQUI::ui()->sendEvent( new YWidgetEvent( _nextButton, YEvent::Activated ) ); _direction = YQWizard::Forward; } @@ -1549,7 +1540,9 @@ void YQWizard::showHelp() void YQWizard::releaseNotesClicked() { - if ( ! _releaseNotesButtonId.isNull() ) + YQUI::ui()->sendEvent( new YWidgetEvent( _nextButton, YEvent::Activated ) ); + + if ( ! _releaseNotesButtonId.empty() ) { y2milestone( "Release Notes button clicked" ); sendEvent( _releaseNotesButtonId ); @@ -1576,16 +1569,16 @@ void YQWizard::showTree() -void YQWizard::addMenu( const QString & text, - const QString & id ) +void YQWizard::addMenu( const string & text, + const string & id ) { if ( _menuBar ) { Q3PopupMenu * menu = new Q3PopupMenu( _menuBar ); YUI_CHECK_NEW( menu ); - _menuIDs.insert( id, menu ); - _menuBar->insertItem( text, menu ); + _menuIDs.insert( fromUTF8( id ), menu ); + _menuBar->insertItem( fromUTF8( text ), menu ); connect( menu, SIGNAL( activated ( int ) ), this, SLOT ( sendMenuEvent( int ) ) ); @@ -1599,35 +1592,35 @@ void YQWizard::addMenu( const QString & text, } -void YQWizard::addSubMenu( const QString & parentMenuID, - const QString & text, - const QString & id ) +void YQWizard::addSubMenu( const string & parentMenuID, + const string & text, + const string & id ) { - Q3PopupMenu * parentMenu = _menuIDs[ parentMenuID ]; + Q3PopupMenu * parentMenu = _menuIDs[ fromUTF8( parentMenuID ) ]; if ( parentMenu ) { Q3PopupMenu * menu = new Q3PopupMenu( _menuBar ); YUI_CHECK_NEW( menu ); - _menuIDs.insert( id, menu ); - parentMenu->insertItem( text, menu ); + _menuIDs.insert( fromUTF8( id ), menu ); + parentMenu->insertItem( fromUTF8( text ), menu ); connect( menu, SIGNAL( activated ( int ) ), this, SLOT ( sendMenuEvent( int ) ) ); } else { - y2error( "Can't find menu with ID %s", (const char *) parentMenuID ); + y2error( "Can't find menu with ID %s", parentMenuID.c_str() ); } } -void YQWizard::addMenuEntry( const QString & parentMenuID, - const QString & text, - const QString & idString ) +void YQWizard::addMenuEntry( const string & parentMenuID, + const string & text, + const string & idString ) { - Q3PopupMenu * parentMenu = _menuIDs[ parentMenuID ]; + Q3PopupMenu * parentMenu = _menuIDs[ fromUTF8( parentMenuID ) ]; if ( parentMenu ) { @@ -1637,14 +1630,14 @@ void YQWizard::addMenuEntry( const QString & parentMenuID, } else { - y2error( "Can't find menu with ID %s", (const char *) parentMenuID ); + y2error( "Can't find menu with ID %s", parentMenuID.c_str() ); } } -void YQWizard::addMenuSeparator( const QString & parentMenuID ) +void YQWizard::addMenuSeparator( const string & parentMenuID ) { - Q3PopupMenu * parentMenu = _menuIDs[ parentMenuID ]; + Q3PopupMenu * parentMenu = _menuIDs[ fromUTF8( parentMenuID ) ]; if ( parentMenu ) { @@ -1652,7 +1645,7 @@ void YQWizard::addMenuSeparator( const QString & parentMenuID ) } else { - y2error( "Can't find menu with ID %s", (const char *) parentMenuID ); + y2error( "Can't find menu with ID %s", parentMenuID.c_str() ); } } @@ -1673,7 +1666,7 @@ void YQWizard::sendMenuEvent( int numID ) { if ( numID >= 0 && numID < (int) _menuEntryIDs.size() ) { - sendEvent( YCPString( toUTF8( _menuEntryIDs[ numID ] ) ) ); + sendEvent( toUTF8( _menuEntryIDs[ numID ] ) ); } else { @@ -1682,35 +1675,12 @@ void YQWizard::sendMenuEvent( int numID ) } -void YQWizard::sendEvent( YWidgetID * rawId ) +void YQWizard::sendEvent( const string & id ) { - if ( rawId ) - { - YCPValueWidgetID * id = dynamic_cast (rawId ); - - if ( id ) - sendEvent( id->value() ); - } -} - - -void YQWizard::sendEvent( YCPValue id ) -{ - // Wizard events are sent as menu events - the semantics are similar. - // - // Widget events wouldn't do since they use their widget's ID as the ID to - // return (which would be inappropriate since that would be the ID of the - // wizard widget). Another type of event (WizardEvent) could be introduced, - // but it would add little more information (if any) than MenuEvent. - // - // YQPackageSelector uses the same approach. After all, one widget that can - // return multiple IDs is roughly the semantics of MenuEvents. - YQUI::ui()->sendEvent( new YMenuEvent( id ) ); } - int YQWizard::preferredWidth() { return sizeHint().width(); @@ -1752,18 +1722,20 @@ bool YQWizard::eventFilter( QObject * obj, QEvent * ev ) } -void YQWizard::setButtonLabel( YQWizardButton * button, const QString & newLabel ) +void YQWizard::setButtonLabel( YPushButton * button, const string & newLabel ) { - if ( button ) - { - button->setLabel( newLabel ); - YDialog::currentDialog()->checkShortcuts(); + button->setLabel( newLabel ); + YDialog::currentDialog()->checkShortcuts(); + + YQWizardButton * wizardButton = dynamic_cast (button); - if ( newLabel.isEmpty() ) + if ( wizardButton ) + { + if ( newLabel.empty() ) { - button->hide(); + wizardButton->hide(); - if ( button == _backButton && _backButtonSpacer ) + if ( wizardButton == _backButton && _backButtonSpacer ) { // Minimize _backButtonSpacer @@ -1774,7 +1746,7 @@ void YQWizard::setButtonLabel( YQWizardButton * button, const QString & newLabel } else { - button->show(); + wizardButton->show(); if ( button == _backButton && _backButtonSpacer ) { @@ -1789,48 +1761,22 @@ void YQWizard::setButtonLabel( YQWizardButton * button, const QString & newLabel } -void YQWizard::setButtonID( YQWizardButton * button, const YCPValue & id ) -{ - if ( button ) - { - button->setId( new YCPValueWidgetID( id ) ); - } -} - - -void YQWizard::enableButton( YQWizardButton * button, bool enabled ) -{ - if ( button == _nextButton && _protectNextButton && ! enabled ) - return; - - if ( button ) - button->setEnabled( enabled ); -} - - -void YQWizard::setButtonFocus( YQWizardButton * button ) -{ - if ( button ) - button->setKeyboardFocus(); -} - - -void YQWizard::showReleaseNotesButton( string label, const YCPValue & id ) +void YQWizard::showReleaseNotesButton( const string & label, const string & id ) { if ( ! _releaseNotesButton ) { y2error( "NULL Release Notes button" ); + if ( ! _stepsBox ) y2error( "This works only if there is a \"steps\" panel!" ); return; } - label = YShortcut::cleanShortcutString( label ); // no way to check the shortcut, so strip it - _releaseNotesButton->setText( fromUTF8( label ) ); + // no way to check the shortcut, so strip it + _releaseNotesButton->setText( fromUTF8( YShortcut::cleanShortcutString( label ) ) ); _releaseNotesButtonId = id; - if ( _releaseNotesButton->isHidden() ) _releaseNotesButton->show(); @@ -1861,205 +1807,4 @@ void YQWizard::retranslateInternalButtons() _treeButton->setText( _( "Tree" ) ); } - -void YQWizard::ping() -{ - y2debug( "YQWizard is active" ); -} - - -bool YQWizard::isCommand( QString declaration, const YCPTerm & term ) -{ - declaration = declaration.simplifyWhiteSpace(); - - // Check command name - - QString command = declaration; - command.remove( QRegExp( "\\s*\\(.*$" ) ); // remove arguments - - if ( term->name().c_str() != command ) - return false; - - // - // Check arguments - // - - QString arg_decl = declaration; - arg_decl.remove( QRegExp( "^.*\\(" ) ); // remove "command (" - arg_decl.remove( QRegExp( "\\).*$" ) ); // remove ")" - - QStringList argDeclList = arg_decl.split( ",", QString::SkipEmptyParts ); - - // - // Check number of arguments - // - - if ( argDeclList.size() != term->size() ) - { - y2error( "Bad arguments for wizard command %s : %s", - (const char *) declaration, term->toString().c_str() ); - return false; - } - - - // - // Check each individual argument - // - - bool ok = true; - - for ( int i=0; i < argDeclList.size() && ok; i++ ) - { - QString wanted = argDeclList[ i ].stripWhiteSpace(); - YCPValue seen = term->value( i ); - - if ( wanted == "string" ) ok = seen->isString(); - else if ( wanted == "boolean" ) ok = seen->isBoolean(); - else if ( wanted == "bool" ) ok = seen->isBoolean(); - else if ( wanted == "list" ) ok = seen->isList(); - else if ( wanted == "map" ) ok = seen->isMap(); - else if ( wanted == "integer" ) ok = seen->isInteger(); - else if ( wanted == "int" ) ok = seen->isInteger(); - else if ( wanted == "any" ) ok = true; - else - { - y2error( "Bad declaration for wizard command %s : Unknown type \"%s\"", - (const char *) declaration, (const char *) wanted ); - } - } - - if ( ! ok ) - { - y2error( "Bad arguments for wizard command %s : %s", - (const char *) declaration, term->toString().c_str() ); - } - - if ( ok && _verboseCommands ) - { - // Intentionally logging as milestone because a YCP app just explicitly - // requested this log level - y2milestone( "Recognized wizard command %s : %s", - (const char *) declaration, term->toString().c_str() ); - } - - return ok; -} - - -QString YQWizard::qStringArg( const YCPTerm & term, int argNo ) -{ - return fromUTF8( stringArg( term, argNo ).c_str() ); -} - - -string YQWizard::stringArg( const YCPTerm & term, int argNo ) -{ - if ( term->size() > argNo ) - { - YCPValue arg( term->value( argNo ) ); - - if ( arg->isString() ) - return arg->asString()->value(); - } - - y2error( "Couldn't convert arg #%d of '%s' to string", argNo, term->toString().c_str() ); - return ""; -} - - -bool YQWizard::boolArg( const YCPTerm & term, int argNo ) -{ - if ( term->size() > argNo ) - { - YCPValue arg( term->value( argNo ) ); - - if ( arg->isBoolean() ) - return arg->asBoolean()->value(); - } - - y2error( "Couldn't convert arg #%d of '%s' to bool", argNo, term->toString().c_str() ); - return false; -} - - -YCPValue YQWizard::anyArg( const YCPTerm & term, int argNo ) -{ - if ( term->size() > argNo ) - { - return term->value( argNo ); - } - - return YCPVoid(); -} - - - -YCPValue YQWizard::command( const YCPTerm & cmd ) -{ -#define OK YCPBoolean( true ); - - - if ( isCommand( "SetHelpText ( string )", cmd ) ) { setHelpText ( qStringArg( cmd, 0 ) ); return OK; } - if ( isCommand( "SetDialogIcon ( string )", cmd ) ) { setDialogIcon ( qStringArg( cmd, 0 ) ); return OK; } - if ( isCommand( "SetDialogHeading ( string )", cmd ) ) { setDialogHeading( qStringArg( cmd, 0 ) ); return OK; } - - if ( isCommand( "SetCurrentStep ( string )", cmd ) ) { setCurrentStep( qStringArg( cmd, 0 ) ); return OK; } - if ( isCommand( "AddStep ( string, string )" , cmd ) ) { addStep( qStringArg( cmd, 0 ), qStringArg( cmd, 1 )); return OK; } - if ( isCommand( "AddStepHeading ( string )", cmd ) ) { addStepHeading( qStringArg( cmd, 0 ) ); return OK; } - if ( isCommand( "DeleteSteps()" , cmd ) ) { deleteSteps(); return OK; } - if ( isCommand( "UpdateSteps()" , cmd ) ) { updateSteps(); return OK; } - - if ( isCommand( "SetAbortButtonLabel ( string )", cmd ) ) { setButtonLabel( _abortButton, qStringArg( cmd, 0 ) ); return OK; } - if ( isCommand( "SetBackButtonLabel ( string )", cmd ) ) { setButtonLabel( _backButton, qStringArg( cmd, 0 ) ); return OK; } - if ( isCommand( "SetNextButtonLabel ( string )", cmd ) ) { setButtonLabel( _nextButton, qStringArg( cmd, 0 ) ); return OK; } - if ( isCommand( "SetCancelButtonLabel ( string )", cmd ) ) { setButtonLabel( _abortButton, qStringArg( cmd, 0 ) ); return OK; } - if ( isCommand( "SetAcceptButtonLabel ( string )", cmd ) ) { setButtonLabel( _nextButton, qStringArg( cmd, 0 ) ); return OK; } - - if ( isCommand( "SetAbortButtonID ( any )" , cmd ) ) { setButtonID( _abortButton, anyArg( cmd, 0 ) ); return OK; } - if ( isCommand( "SetBackButtonID ( any )" , cmd ) ) { setButtonID( _backButton, anyArg( cmd, 0 ) ); return OK; } - if ( isCommand( "SetNextButtonID ( any )" , cmd ) ) { setButtonID( _nextButton, anyArg( cmd, 0 ) ); return OK; } - - if ( isCommand( "EnableBackButton ( bool )" , cmd ) ) { enableButton( _backButton, boolArg( cmd, 0 ) ); return OK; } - if ( isCommand( "EnableNextButton ( bool )" , cmd ) ) { enableButton( _nextButton, boolArg( cmd, 0 ) ); return OK; } - if ( isCommand( "EnableAbortButton ( bool )" , cmd ) ) { enableButton( _abortButton, boolArg( cmd, 0 ) ); return OK; } - if ( isCommand( "ProtectNextButton ( bool )" , cmd ) ) { _protectNextButton = boolArg( cmd, 0 ); return OK; } - - if ( isCommand( "SetFocusToNextButton ()" , cmd ) ) { setButtonFocus( _nextButton ); return OK; } - if ( isCommand( "SetFocusToBackButton ()" , cmd ) ) { setButtonFocus( _backButton ); return OK; } - - - if ( isCommand( "SetVerboseCommands ( bool )" , cmd ) ) { setVerboseCommands( boolArg( cmd, 0 ) ); return OK; } - - if ( isCommand( "DeleteTreeItems()" , cmd ) ) { deleteTreeItems(); return OK; } - if ( isCommand( "SelectTreeItem( string )" , cmd ) ) { selectTreeItem( qStringArg( cmd, 0 ) ); return OK; } - if ( isCommand( "AddTreeItem( string, string, string )", cmd ) ) { addTreeItem ( qStringArg( cmd, 0 ), - qStringArg( cmd, 1 ), - qStringArg( cmd, 2 ) ); return OK; } - - if ( isCommand( "AddMenu ( string, string )" , cmd ) ) { addMenu ( qStringArg( cmd, 0 ), - qStringArg( cmd, 1 ) ); return OK; } - - if ( isCommand( "AddSubMenu ( string, string, string )" , cmd ) ) { addSubMenu ( qStringArg( cmd, 0 ), - qStringArg( cmd, 1 ), - qStringArg( cmd, 2 ) ); return OK; } - - if ( isCommand( "AddMenuEntry ( string, string, string )" , cmd ) ) { addMenuEntry ( qStringArg( cmd, 0 ), - qStringArg( cmd, 1 ), - qStringArg( cmd, 2 ) ); return OK; } - - if ( isCommand( "AddMenuSeparator ( string )" , cmd ) ) { addMenuSeparator( qStringArg( cmd, 0 ) ); return OK; } - if ( isCommand( "DeleteMenus ()" , cmd ) ) { deleteMenus(); return OK; } - if ( isCommand( "ShowReleaseNotesButton( string, any )" , cmd ) ) { showReleaseNotesButton( stringArg( cmd, 0 ), - anyArg ( cmd, 1 )); return OK; } - if ( isCommand( "HideReleaseNotesButton()" , cmd ) ) { hideReleaseNotesButton(); return OK; } - if ( isCommand( "RetranslateInternalButtons()" , cmd ) ) { retranslateInternalButtons() ; return OK; } - if ( isCommand( "Ping()" , cmd ) ) { ping() ; return OK; } - y2error( "Undefined wizard command: %s", cmd->toString().c_str() ); - return YCPBoolean( false ); - -#undef OK -} - - - #include "YQWizard.moc" diff --git a/src/YQWizard.h b/src/YQWizard.h index 2f9c442..6da665a 100644 --- a/src/YQWizard.h +++ b/src/YQWizard.h @@ -20,7 +20,6 @@ #ifndef YQWizard_h #define YQWizard_h -#include "YWizard.h" #include #include #include @@ -32,6 +31,8 @@ #include #include #include +#include +#include "YQWizardButton.h" #include #include @@ -46,10 +47,10 @@ class QSpacerItem; class Q3TextBrowser; class QToolButton; class Q3WidgetStack; +class YReplacePoint; class YQAlignment; class YQReplacePoint; -class YQWizardButton; class QY2ListView; @@ -66,9 +67,9 @@ public: * Constructor. **/ YQWizard( YWidget * parent, - YWidgetID * backButtonId, const string & backButtonLabel, - YWidgetID * abortButtonId, const string & abortButtonLabel, - YWidgetID * nextButtonId, const string & nextButtonLabel, + const string & backButtonLabel, + const string & abortButtonLabel, + const string & nextButtonLabel, YWizardMode wizardMode = YWizardMode_Standard ); /** @@ -76,6 +77,12 @@ public: **/ virtual ~YQWizard(); + /** + * Returns a descriptive label of this dialog instance for debugging. + * + * Reimplemented from YWidget. + **/ + virtual string debugLabel(); enum Direction { Forward, Backward }; @@ -86,176 +93,251 @@ public: **/ Direction direction() const { return _direction; } - /** - * Generic direct access to implementation-specific functions. - * See YQWizard.cc for details. - * - * Returns 'true' on success, 'false' on failure. - * Reimplemented from YWizard. - **/ - virtual YCPValue command( const YCPTerm & command ); + // + // Wizard basics + // /** - * Returns a descriptive label of this dialog instance for debugging. + * Return internal widgets. * - * Reimplemented from YWidget. + * Implemented from YWizard. **/ - virtual string debugLabel(); + virtual YQWizardButton * backButton() const { return _backButton; } + virtual YQWizardButton * abortButton() const { return _abortButton; } + virtual YQWizardButton * nextButton() const { return _nextButton; } - /** - * Preferred width of the widget. - * - * Reimplemented from YWidget. - **/ - virtual int preferredWidth(); + virtual YReplacePoint * contentsReplacePoint() const { return _contentsReplacePoint; } /** - * Preferred height of the widget. + * Set the label of one of the wizard buttons (backButton(), abortButton(), + * nextButton() ) if that button is non-null. * - * Reimplemented from YWidget. + * Implemented from YWizard. **/ - virtual int preferredHeight(); - + virtual void setButtonLabel( YPushButton * button, const string & newLabel ); + /** - * Set the new size of the widget. + * Set the help text. * - * Reimplemented from YWidget. + * Implemented from YWizard. **/ - virtual void setSize( int newWidth, int newHeight ); + virtual void setHelpText( const string & helpText ); /** - * Event filter - inherited from QWidget. + * Set the dialog icon. An empty icon name clears the current icon. + * + * Implemented from YWizard. **/ - virtual bool eventFilter( QObject * obj, QEvent * ev ); + virtual void setDialogIcon( const string & iconName ); /** - * Set a dialog icon. 0 is a valid value - it clears the current icon. + * Set the dialog heading. + * + * Implemented from YWizard. **/ - void setDialogIcon( const char * iconName ); + virtual void setDialogHeading( const string & headingText ); - /** - * Set a dialog heading. 0 is a valid value - it clears the old text. - **/ - void setDialogHeading( const QString & headingText ); - /** - * Returns 'true' if this wizard was created with steps enabled, i.e. the - * side bar has a "steps" view. - **/ - bool stepsEnabled() const { return _stepsEnabled; } + // + // Steps handling + // /** * Add a step for the steps panel on the side bar. * This only adds the step to the internal list of steps. * The display is only updated upon calling updateSteps(). + * + * Implemented from YWizard. **/ - void addStep( const QString & text, const QString & id ); + virtual void addStep( const string & text, const string & id ); /** * Add a step heading for the steps panel on the side bar. * This only adds the heading to the internal list of steps. * The display is only updated upon calling updateSteps(). + * + * Implemented from YWizard. **/ - void addStepHeading( const QString & text ); + virtual void addStepHeading( const string & text ); /** * Delete all steps and step headings from the internal lists. * The display is only updated upon calling updateSteps(). + * + * Implemented from YWizard. **/ - void deleteSteps(); + virtual void deleteSteps(); /** * Set the current step. This also triggers updateSteps() if necessary. + * + * Implemented from YWizard. **/ - void setCurrentStep( const QString & id ); + virtual void setCurrentStep( const string & id ); /** * Update the steps display: Reflect the internal steps and heading lists * in the layout. + * + * Implemented from YWizard. **/ - void updateSteps(); - - /** - * Returns 'true' if this wizard was created with a selection tree enabled, - * i.e. the side bar has a tree selection. - **/ - bool treeEnabled() const { return _treeEnabled; } - - /** - * Returns the wizard's "Next" (or "Accept") button. - **/ - YQWizardButton * nextButton() const { return _nextButton; } - - /** - * Returns the wizard's "Back" button. - **/ - YQWizardButton * backButton() const { return _backButton; } - - /** - * Returns the wizard's "Abort" button. - **/ - YQWizardButton * abortButton() const { return _abortButton; } + virtual void updateSteps(); - /** - * Set wizard command verbosity - **/ - void setVerboseCommands( bool verbose ) { _verboseCommands = verbose; } + // + // Tree handling + // /** * Add a tree item. If "parentID" is an empty string, it will be a root * item. 'text' is the text that will be displayed in the tree, 'id' the ID * with which this newly created item can be referenced - and that will be * returned when the user clicks on a tree item. + * + * Implemented from YWizard. **/ - void addTreeItem( const QString & parentID, - const QString & text, - const QString & id ); + virtual void addTreeItem( const string & parentID, + const string & text, + const string & id ); /** * Select the tree item with the specified ID, if such an item exists. + * + * Implemented from YWizard. + **/ + virtual void selectTreeItem( const string & id ); + + /** + * Returns the current tree selection or an empty string if nothing is + * selected or there is no tree. + * + * Implemented from YWizard. **/ - void selectTreeItem( const QString & id ); + virtual string currentTreeSelection(); /** * Delete all tree items. + * + * Implemented from YWizard. **/ - void deleteTreeItems(); + virtual void deleteTreeItems(); + + // + // Menu handling + // /** * Add a menu to the menu bar. If the menu bar is not visible yet, it will * be made visible. 'text' is the user-visible text for the menu bar * (including keyboard shortcuts marked with '&'), 'id' is the menu ID for * later addMenuEntry() etc. calls. + * + * Implemented from YWizard. **/ - void addMenu( const QString & text, - const QString & id ); + virtual void addMenu( const string & text, + const string & id ); /** * Add a submenu to the menu with ID 'parentMenuID'. + * + * Implemented from YWizard. **/ - void addSubMenu( const QString & parentMenuID, - const QString & text, - const QString & id ); + virtual void addSubMenu( const string & parentMenuID, + const string & text, + const string & id ); /** * Add a menu entry to the menu with ID 'parentMenuID'. 'id' is what will * be returned by UI::UserInput() etc. when a user activates this menu entry. + * + * Implemented from YWizard. **/ - void addMenuEntry( const QString & parentMenuID, - const QString & text, - const QString & id ); + virtual void addMenuEntry( const string & parentMenuID, + const string & text, + const string & id ); /** * Add a menu separator to a menu. + * + * Implemented from YWizard. **/ - void addMenuSeparator( const QString & parentMenuID ); + virtual void addMenuSeparator( const string & parentMenuID ); /** * Delete all menus and hide the menu bar. + * + * Implemented from YWizard. **/ - void deleteMenus(); + virtual void deleteMenus(); + + + // + // Misc + // + + /** + * Show a "Release Notes" button above the "Help" button in the steps panel + * with the specified label that will return the specified id to + * UI::UserInput() when clicked. + * + * The button (or the wizard) will assume ownership of the id and delete it + * in the destructor. + * + * Implemented from YWizard. + **/ + virtual void showReleaseNotesButton( const string & label, + const string & id ); + + /** + * Hide an existing "Release Notes" button. + * + * Implemented from YWizard. + **/ + virtual void hideReleaseNotesButton(); + + /** + * Retranslate internal buttons that are not accessible from the outside: + * - [Help] + * - [Steps] + * - [Tree] + * + * Implemented from YWizard. + **/ + virtual void retranslateInternalButtons(); + + /** + * Event filter. + * + * Reimplemented from QWidget. + **/ + virtual bool eventFilter( QObject * obj, QEvent * ev ); + + // + // Geometry management + // + + /** + * Preferred width of the widget. + * + * Reimplemented from YWidget. + **/ + virtual int preferredWidth(); + + /** + * Preferred height of the widget. + * + * Reimplemented from YWidget. + **/ + virtual int preferredHeight(); + + /** + * Set the new size of the widget. + * + * Reimplemented from YWidget. + **/ + virtual void setSize( int newWidth, int newHeight ); + signals: @@ -275,17 +357,12 @@ signals: * Notice: As long as this signal is connected, the wizard will no longer * send button events to the UI. Rather, the connected QObject has to take * care to propagate those events. - * This is used in YQPatternSelector, for example. + * This is used in YQPatternSelector, for example. **/ void nextClicked(); - -public slots: - /** - * Set the help text. 0 is a valid value - it clears the old text. - **/ - void setHelpText( QString helpText ); +public slots: /** * Adapt the size of the client area (the ReplacePoint(`id(`contents)) to @@ -360,7 +437,7 @@ protected slots: void slotNextClicked(); /** - * Propagate button clicked event of release notes button to the YCP + * Propagate button clicked event of release notes button to the * application. **/ void releaseNotesClicked(); @@ -387,14 +464,6 @@ protected slots: void sendMenuEvent( int numID ); - /** - * Retranslate internal buttons that are not accessible from the outside: - * - [Help] - * - [Steps] - * - [Tree] - **/ - void retranslateInternalButtons(); - protected: // Layout functions @@ -443,8 +512,7 @@ protected: /** * Send a wizard event with the specified ID. **/ - void sendEvent( YCPValue id ); - void sendEvent( YWidgetID * id ); + void sendEvent( const string & id ); /** * Returns 'true' if the application is running on a high-color display, @@ -466,54 +534,11 @@ protected: **/ void disconnectNotify ( const char * signal ); - // - // Wizard command mini-parser - // - - /** - * Check if 'term' matches wizard command 'declaration'. - * 'declaration' is a function prototype like this: - * - * myFunction ( string, boolean, string ) - * - * Void functions are declared without any parameters: - * - * myFunction () - * - * Function names must be unique. They cannot be overloaded. - **/ - bool isCommand( QString declaration, const YCPTerm & term ); - - /** - * Return argument number 'argNo' from 'term' as QString. - **/ - QString qStringArg( const YCPTerm & term, int argNo ); - - /** - * Return argument number 'argNo' from 'term' as std::string. - **/ - std::string stringArg( const YCPTerm & term, int argNo ); - - /** - * Return argument number 'argNo' from 'term' as bool. - **/ - bool boolArg( const YCPTerm & term, int argNo ); - - /** - * Return argument as type 'any' (plain YCPValue) - **/ - YCPValue anyArg( const YCPTerm & term, int argNo ); - /** * Set a button's label. **/ void setButtonLabel( YQWizardButton * button, const QString & newLabel ); - /** - * Set a button's ID. - **/ - void setButtonID( YQWizardButton * button, const YCPValue & id ); - /** * Enable or disable a button. **/ @@ -539,41 +564,19 @@ protected: * found at all. * Returns the item or 0 if no such item found. **/ - YQWizard::TreeItem * findTreeItem( const QString & id ); - - /** - * Returns the current tree selection or an empty string if nothing is - * selected or there is no tree. - * - * Reimplemented from YWizard. - **/ - YCPString currentTreeSelection(); - - /** - * Show a "Release Notes" button above the "Help" button in the steps panel - * with the specified label that will return the specified id to - * UI::UserInput() when clicked. - **/ - void showReleaseNotesButton( string label, const YCPValue & id ); - - /** - * Hide an existing "Release Notes" button. - **/ - void hideReleaseNotesButton(); - - /** - * NOP command just to check if a YQWizard is running - **/ - void ping(); + YQWizard::TreeItem * findTreeItem( const string & id ); // // Data members // + string _backButtonLabel; + string _abortButtonLabel; + string _nextButtonLabel; + bool _stepsEnabled; bool _treeEnabled; - bool _verboseCommands; bool _protectNextButton; bool _stepsDirty; bool _sendButtonEvents; @@ -601,7 +604,7 @@ protected: Q3VBox * _stepsBox; Q3GridLayout * _stepsGrid; QPushButton * _releaseNotesButton; - YCPValue _releaseNotesButtonId; + string _releaseNotesButtonId; QPushButton * _helpButton; Q3HBox * _helpPanel; Q3TextBrowser * _helpBrowser; @@ -620,12 +623,13 @@ protected: QSpacerItem * _backButtonSpacer; YQWizardButton * _abortButton; YQWizardButton * _nextButton; + YReplacePoint * _contentsReplacePoint; Q3PtrList _stepsList; Q3Dict _stepsIDs; Q3Dict _treeIDs; Q3Dict _menuIDs; - vector _menuEntryIDs; + vector _menuEntryIDs; protected: diff --git a/src/YQWizardButton.cc b/src/YQWizardButton.cc index 867e161..2af4d5c 100644 --- a/src/YQWizardButton.cc +++ b/src/YQWizardButton.cc @@ -30,8 +30,7 @@ YQWizardButton::YQWizardButton( YQWizard * wizard, QWidget * buttonParent, - const string & label, - YWidgetID * id ) + const string & label ) : YQGenericButton( wizard, label ) , _wizard( wizard ) { @@ -41,9 +40,6 @@ YQWizardButton::YQWizardButton( YQWizard * wizard, setQPushButton( button ); setWidgetRep( button ); - if ( id ) - setId( id ); - connect( button, SIGNAL( clicked() ), this, SIGNAL( clicked() ) ); diff --git a/src/YQWizardButton.h b/src/YQWizardButton.h index 35b60cf..3451b83 100644 --- a/src/YQWizardButton.h +++ b/src/YQWizardButton.h @@ -26,7 +26,6 @@ using std::string; class YQDialog; class YQWizard; -class YWidgetID; class YQWizardButton : public YQGenericButton @@ -39,8 +38,7 @@ public: **/ YQWizardButton( YQWizard * wizard, QWidget * buttonParent, - const string & label, - YWidgetID * id = 0 ); + const string & label ); /** * Destructor. diff --git a/yast2-qt4.spec.in b/yast2-qt4.spec.in index e9ea2a2..1ee5f6c 100644 --- a/yast2-qt4.spec.in +++ b/yast2-qt4.spec.in @@ -5,7 +5,8 @@ BuildRequires: dbus-1-devel boost-devel libzypp-devel curl-devel docbook-xsl-stylesheets doxygen libdrm-devel libjpeg-devel libxcrypt-devel libxslt perl-XML-Writer libqt4-devel rpm-devel sgml-skel update-desktop-files yast2-devtools yast2-core-devel hal-devel Summary: - -BuildRequires: yast2-core-devel >= 2.15.6 +BuildRequires: yast2-core-devel >= 2.16.10 +Requires: yast2-core >= 2.16.10 Requires: libzypp >= 3.11.8 Provides: yast2_ui Provides: y2base:/var/lib/YaST2/servers/qt -- 2.39.2