1 /*---------------------------------------------------------------------\
3 | __ __ ____ _____ ____ |
4 | \ \ / /_ _/ ___|_ _|___ \ |
5 | \ V / _` \___ \ | | __) | |
6 | | | (_| |___) || | / __/ |
7 | |_|\__,_|____/ |_| |_____| |
11 \----------------------------------------------------------------------/
15 Author: Stefan Hundhammer <sh@suse.de>
17 Textdomain "packages-qt"
22 #define y2log_component "qt-wizard"
23 #include <ycp/y2log.h>
25 // For the command parser
28 #include <YShortcut.h>
31 #include <QSvgRenderer>
33 #include <QStackedWidget>
34 #include "ui_QHelpDialog.h"
39 #include <qmenudata.h>
42 #include <qpushbutton.h>
44 #include <qtabwidget.h>
45 #include <qtoolbutton.h>
47 #include "QY2ListView.h"
48 #include "QY2Styler.h"
49 #include <QGridLayout>
55 #include "YQApplication.h"
57 #include "YQAlignment.h"
58 #include "YQReplacePoint.h"
61 #include "YQWizardButton.h"
62 #include "YQIconPool.h"
63 #include "YQWidgetFactory.h"
64 #include "YQSignalBlocker.h"
73 #define TEXTDOMAIN "packages-qt"
75 #define USE_ICON_ON_HELP_BUTTON 0
78 YQWizard::YQWizard( YWidget * parent,
79 const string & backButtonLabel,
80 const string & abortButtonLabel,
81 const string & nextButtonLabel,
82 YWizardMode wizardMode )
83 : QFrame( (QWidget *) parent->widgetRep() )
89 , _backButtonLabel( backButtonLabel )
90 , _abortButtonLabel( abortButtonLabel )
91 , _nextButtonLabel( nextButtonLabel )
93 setObjectName( "wizard" );
95 QHBoxLayout* layout = new QHBoxLayout( this );
96 layout->setSpacing( 0 );
97 layout->setMargin( 0 );
101 _stepsEnabled = (wizardMode == YWizardMode_Steps);
102 _treeEnabled = (wizardMode == YWizardMode_Tree);
105 _direction = YQWizard::Forward;
112 _releaseNotesButton = 0;
123 _sendButtonEvents = true;
124 _contentsReplacePoint = 0;
126 YQUI::setTextdomain( TEXTDOMAIN );
128 //layoutTitleBar( this );
130 layout->addLayout( layoutSideBar( this ) );
131 layout->addWidget( layoutWorkArea( this ) );
133 QY2Styler::self()->registerWidget( this );
138 YQWizard::~YQWizard()
145 void YQWizard::layoutTitleBar( QWidget * parent )
147 QFrame * titleBar = new QFrame( parent );
148 YUI_CHECK_NEW( titleBar );
150 QHBoxLayout *layout = new QHBoxLayout( titleBar );
151 titleBar->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); // hor/vert
157 QLabel * left = new QLabel( titleBar );
158 layout->addWidget( left );
159 left->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) ); // hor/vert
160 left->setObjectName( "titleBar-left" );
163 // Center stretch space
166 layout->addStretch( 10 );
173 QLabel * right = new QLabel( titleBar );
174 YUI_CHECK_NEW( right );
176 layout->addWidget( right );
177 right->setObjectName( "titleBar-right" );
182 QLayout *YQWizard::layoutSideBar( QWidget * parent )
184 _sideBar = new QStackedWidget( parent );
185 YUI_CHECK_NEW( _sideBar );
186 _sideBar->setMinimumWidth( YQUI::ui()->defaultSize( YD_HORIZ ) / 5 );
187 _sideBar->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Preferred ) ); // hor/vert
188 _sideBar->setObjectName( QString( "_sideBar-%1" ).arg( long( this ) ) );
190 QVBoxLayout *vbox = new QVBoxLayout( );
191 vbox->addWidget( _sideBar );
198 else if ( _stepsEnabled )
208 void YQWizard::layoutStepsPanel()
211 _stepsPanel = new QFrame( _sideBar );
212 _sideBar->addWidget( _stepsPanel );
213 _sideBar->setObjectName( "steps" );
214 QY2Styler::self()->registerWidget( _sideBar );
215 _stepsPanel->setProperty( "class", "steps QFrame" );
217 // Steps panel bottom buttons ("Help", "Release Notes")
219 // Layouts for the buttons
221 _releaseNotesButton = new QPushButton( _( "Release Notes..." ), _stepsPanel );
222 _releaseNotesButton->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Minimum ) ); // hor/vert
224 connect( _releaseNotesButton, SIGNAL( clicked() ),
225 this, SLOT ( releaseNotesClicked() ) );
227 _releaseNotesButton->hide(); // hidden until showReleaseNotesButton() is called
229 _stepsDirty = true; // no layout yet
234 void YQWizard::addStep( const string & text, const string & id )
236 QString qId = fromUTF8( id );
238 if ( _stepsIDs[ qId ] )
240 y2error( "Step ID \"%s\" (\"%s\") already used for \"%s\"",
243 qPrintable( _stepsIDs[ qId ]->name() ) );
247 if ( !_stepsList.empty() && _stepsList.last()->name() == fromUTF8( text ) )
249 // Consecutive steps with the same name will be shown as one single step.
251 // Since steps are always added at the end of the list, it is
252 // sufficient to check the last step of the list. If the texts are the
253 // same, the other with the same text needs to get another (additional)
254 // ID to make sure setCurrentStep() works as it should.
255 _stepsList.last()->addID( qId );
259 _stepsList.append( new YQWizard::Step( fromUTF8( text ), qId ) );
263 _stepsIDs.insert( qId, _stepsList.last() );
268 void YQWizard::addStepHeading( const string & text )
270 _stepsList.append( new YQWizard::StepHeading( fromUTF8( text ) ) );
276 void YQWizard::updateSteps()
281 // Create a grid layout for the steps
282 delete _stepsPanel->layout();
283 QVBoxLayout *_stepsVBox = new QVBoxLayout( _stepsPanel );
285 QGridLayout *_stepsGrid = new QGridLayout( );
286 _stepsGrid->setObjectName( QString( "_stepsGrid_%1" ).arg( long( this ) ) );
287 YUI_CHECK_NEW( _stepsGrid );
288 _stepsVBox->addLayout( _stepsGrid );
289 _stepsGrid->setColumnMinimumWidth( 0, 10 );
290 _stepsGrid->setRowStretch( 0, 1 );
291 _stepsGrid->setRowStretch( 1, 1 );
292 _stepsGrid->setRowStretch( 2, 99 );
294 const int statusCol = 1;
295 const int nameCol = 2;
300 // Create widgets for all steps and step headings in the internal list
303 for ( QList<Step*>::iterator i = _stepsList.begin(); i != _stepsList.end(); ++i)
305 YQWizard::Step * step = *i;
307 step->deleteLabels();
309 if ( step->isHeading() )
315 qDebug( "%p - add Stepheading %s", this, qPrintable( step->name() ) );
316 QLabel * label = new QLabel( step->name(), _stepsPanel );
317 YUI_CHECK_NEW( label );
318 label->setObjectName( step->name() );
319 label->setAlignment( Qt::AlignLeft | Qt::AlignTop );
320 label->setProperty( "class", "steps_heading" );
322 step->setNameLabel( label );
323 _stepsGrid->addWidget( label,
325 1, nameCol - statusCol + 1);
327 else // No heading - ordinary step
333 qDebug( "%p - add Step %s", this, qPrintable( step->name() ) );
334 QLabel * statusLabel = new QLabel( _stepsPanel );
335 YUI_CHECK_NEW( statusLabel );
337 step->setStatusLabel( statusLabel );
338 statusLabel->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum );
339 _stepsGrid->addWidget( statusLabel, row, statusCol );
345 QLabel * nameLabel = new QLabel( step->name(), _stepsPanel );
346 YUI_CHECK_NEW( nameLabel );
347 nameLabel->setAlignment( Qt::AlignLeft | Qt::AlignTop );
348 nameLabel->setObjectName( step->name() );
350 step->setNameLabel( nameLabel );
351 _stepsGrid->addWidget( nameLabel, row, nameCol );
357 _stepsVBox->addStretch( 99 );
358 QVBoxLayout *rbl = new QVBoxLayout();
359 rbl->addWidget( _releaseNotesButton, 0, Qt::AlignCenter );
361 _stepsVBox->addLayout( rbl );
362 _stepsVBox->addStretch( 29 );
368 void YQWizard::updateStepStates()
373 YQWizard::Step * currentStep = findStep( _currentStepID );
374 QList<YQWizard::Step*>::iterator step = _stepsList.begin();
378 // Set status icon and color for the current step
379 currentStep->setStatus( Step::Current );
382 // Set all steps before the current to "done"
385 while ( step != _stepsList.end() && *step != currentStep )
387 ( *step )->setStatus( Step::Done );
391 // Skip the current step - continue with the step after it
393 if ( step != _stepsList.end() )
398 // Set all steps after the current to "to do"
401 while ( step != _stepsList.end() )
403 ( *step )->setStatus( Step::Todo );
408 void YQWizard::setCurrentStep( const string & id )
410 _currentStepID = fromUTF8( id );
415 void YQWizard::deleteSteps()
417 qDeleteAll(_stepsList);
423 YQWizard::Step * YQWizard::findStep( const QString & id )
428 return _stepsIDs[ id ];
432 void YQWizard::layoutTreePanel()
434 _treePanel = new QFrame( _sideBar );
435 YUI_CHECK_NEW( _treePanel );
436 QHBoxLayout *layout = new QHBoxLayout( _treePanel );
437 _sideBar->addWidget( _treePanel );
439 QVBoxLayout * vbox = new QVBoxLayout();
440 YUI_CHECK_NEW( vbox );
441 layout->addLayout( vbox );
445 _tree = new QY2ListView( _treePanel );
446 YUI_CHECK_NEW( _tree );
447 vbox->addWidget( _tree );
450 // _tree->addColumn( "" );
451 // _tree->header()->hide();
453 _tree->setRootIsDecorated( true );
454 _tree->setSortByInsertionSequence( true );
456 connect( _tree, SIGNAL( itemSelectionChanged ( void ) ),
457 this, SLOT ( treeSelectionChanged ( void ) ) );
459 connect( _tree, SIGNAL( itemActivated ( QTreeWidgetItem *, int ) ),
460 this, SLOT ( sendTreeEvent ( QTreeWidgetItem * ) ) );
462 connect( _tree, SIGNAL( itemDoubleClicked ( QTreeWidgetItem *, int ) ),
463 this, SLOT ( sendTreeEvent ( QTreeWidgetItem * ) ) );
468 void YQWizard::addTreeItem( const string & parentID, const string & text, const string & id )
470 QString qId = fromUTF8( id );
474 y2error( "YQWizard widget not created with `opt(`treeEnabled) !" );
478 YQWizard::TreeItem * item = 0;
479 YQWizard::TreeItem * parent = 0;
481 if ( ! parentID.empty() )
483 parent = findTreeItem( parentID );
488 item = new YQWizard::TreeItem( parent, fromUTF8( text ), qId );
489 YUI_CHECK_NEW( item );
493 item = new YQWizard::TreeItem( _tree, fromUTF8( text ), qId );
494 YUI_CHECK_NEW( item );
497 if ( ! qId.isEmpty() )
498 _treeIDs.insert( qId, item );
503 void YQWizard::deleteTreeItems()
513 YQWizard::TreeItem * YQWizard::findTreeItem( const string & id )
518 return _treeIDs[ fromUTF8( id ) ];
522 void YQWizard::selectTreeItem( const string & id )
526 YQWizard::TreeItem * item = findTreeItem( id );
530 YQSignalBlocker sigBlocker( _tree );
532 _tree->setCurrentItem(item);
533 _tree->scrollToItem(item);
539 void YQWizard::sendTreeEvent( QTreeWidgetItem * listViewItem )
543 YQWizard::TreeItem * item = dynamic_cast<YQWizard::TreeItem *> ( listViewItem );
545 if ( item && ! item->id().isEmpty() )
546 sendEvent( toUTF8( item->id() ) );
551 void YQWizard::treeSelectionChanged()
552 { //FIXME is currentItem correct or selected.first
554 sendTreeEvent( _tree->currentItem() );
558 string YQWizard::currentTreeSelection()
562 QTreeWidgetItem * sel = _tree->currentItem();
566 YQWizard::TreeItem * item = dynamic_cast<YQWizard::TreeItem *> (sel);
568 if ( item && ! item->id().isEmpty() )
569 return toUTF8( item->id() );
578 QWidget *YQWizard::layoutWorkArea( QWidget * parent )
580 QFrame *workArea = new QFrame( parent );
581 workArea->setObjectName( "work_area" );
583 QY2Styler::self()->registerWidget( workArea );
585 QVBoxLayout *vbox = new QVBoxLayout( workArea );
587 _menuBar = new QMenuBar( workArea );
588 YUI_CHECK_NEW( _menuBar );
590 _menuBar->hide(); // will be made visible when menus are added
591 vbox->addWidget( _menuBar );
594 // Dialog icon and heading
597 QHBoxLayout * headingHBox = new QHBoxLayout();
598 YUI_CHECK_NEW( headingHBox );
599 //headingHBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ) ); // hor/vert
600 vbox->addLayout( headingHBox );
602 _dialogIcon = new QLabel( workArea );
603 YUI_CHECK_NEW( _dialogIcon );
604 headingHBox->addWidget( _dialogIcon );
605 _dialogIcon->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ) ); // hor/vert
606 _dialogIcon->setObjectName( "DialogIcon" );
608 _dialogHeading = new QLabel( workArea );
609 YUI_CHECK_NEW( _dialogHeading );
610 headingHBox->addWidget( _dialogHeading );
611 _dialogHeading->setAlignment( Qt::AlignLeft );
612 _dialogHeading->setWordWrap( true );
613 _dialogHeading->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ) ); // hor/vert
614 _dialogHeading->setObjectName( "DialogHeading" );
617 // Client area (the part that belongs to the YCP application)
620 layoutClientArea( workArea );
621 vbox->addWidget( _clientArea );
627 QLayout *bb = layoutButtonBox( workArea );
628 vbox->addLayout( bb );
635 void YQWizard::layoutClientArea( QWidget * parent )
637 _clientArea = new QFrame( parent );
638 YUI_CHECK_NEW( _clientArea );
639 _clientArea->setObjectName("_clientArea");
640 QVBoxLayout *layout = new QVBoxLayout( _clientArea );
641 layout->setMargin( 0 );
644 // HVCenter for wizard contents
647 _contents = new YQAlignment( this, _clientArea, YAlignCenter, YAlignCenter );
648 YUI_CHECK_NEW( _contents );
649 layout->addWidget( _contents );
650 _contents->QObject::setProperty( "class", "Contents" );
652 _contents->setStretchable( YD_HORIZ, true );
653 _contents->setStretchable( YD_VERT, true );
654 _contents->installEventFilter( this );
655 _contents->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) ); // hor/vert
658 // Replace point for wizard contents
661 _contentsReplacePoint = YUI::widgetFactory()->createReplacePoint( _contents );
664 // Initial YEmpty widget contents of replace point
667 YUI::widgetFactory()->createEmpty( _contentsReplacePoint );
668 _contentsReplacePoint->showChild();
674 QLayout *YQWizard::layoutButtonBox( QWidget * parent )
677 // QHBoxLayout for the buttons
680 QHBoxLayout * hbox = new QHBoxLayout(); // parent, spacing
681 YUI_CHECK_NEW( hbox );
683 hbox->setSpacing( 0 );
684 hbox->setMargin( 0 );
686 // Help button - intentionally without keyboard shortcut
687 _helpButton = new QPushButton( _( "Help" ), parent );
688 YUI_CHECK_NEW( _helpButton );
690 connect( _helpButton, SIGNAL( clicked() ),
691 this, SLOT ( showHelp() ) );
693 hbox->addWidget( _helpButton );
695 hbox->addStretch( 10 );
701 _abortButton = new YQWizardButton( this, parent, _abortButtonLabel );
702 YUI_CHECK_NEW( _abortButton );
704 hbox->addWidget( (QWidget *) _abortButton->widgetRep() );
705 connect( _abortButton, SIGNAL( clicked() ),
706 this, SLOT ( slotAbortClicked() ) );
708 hbox->addSpacing( 10 );
714 _backButton = new YQWizardButton( this, parent, _backButtonLabel );
715 YUI_CHECK_NEW( _backButton );
717 hbox->addWidget( (QWidget *) _backButton->widgetRep() );
718 connect( _backButton, SIGNAL( clicked() ),
719 this, SLOT ( slotBackClicked() ) );
721 if ( _backButton->text().isEmpty() )
728 hbox->addSpacing( 5 );
730 _nextButton = new YQWizardButton( this, parent, _nextButtonLabel );
731 YUI_CHECK_NEW( _nextButton );
733 hbox->addWidget( (QWidget *) _nextButton->widgetRep() );
734 connect( _nextButton, SIGNAL( clicked() ),
735 this, SLOT ( slotNextClicked() ) );
740 void YQWizard::destroyButtons()
753 void YQWizard::connectNotify ( const char * signal )
755 if ( QString( signal ).contains( "nextClicked()" ) )
757 y2debug( "nextClicked connected, no longer directly sending button events" );
758 _sendButtonEvents = false;
763 void YQWizard::disconnectNotify ( const char * signal )
765 if ( QString( signal ).contains( "nextClicked()" ) )
767 y2debug( "nextClicked disconnected, directly sending button events again" );
768 _sendButtonEvents = true;
773 void YQWizard::setDialogIcon( const string & iconName )
777 if ( ! iconName.empty() )
779 QPixmap icon( iconName.c_str() );
782 y2warning( "Couldn't load dialog icon \"%s\"", iconName.c_str() );
785 _dialogIcon->setPixmap( icon );
786 topLevelWidget()->setWindowIcon( icon );
791 _dialogIcon->clear();
792 topLevelWidget()->setWindowIcon( QIcon() );
798 void YQWizard::setDialogHeading( const string & headingText )
800 if ( _dialogHeading )
802 if ( ! headingText.empty() )
803 _dialogHeading->setText( fromUTF8( headingText ) );
805 _dialogHeading->clear();
809 string YQWizard::debugLabel()
811 if ( _dialogHeading )
813 QString label = _dialogHeading->text();
814 label = label.simplified(); // Replace any embedded newline with a single blank
816 if ( ! label.isEmpty() )
818 label.prepend( "YQWizard \"" );
819 label.append( "\"" );
821 return toUTF8( label );
825 return "untitled YQWizard";
828 void YQWizard::setHelpText( const string & helpText )
830 _qHelpText = fromUTF8( helpText );
831 _qHelpText.replace( "&product;", YQUI::ui()->productName() );
835 void YQWizard::slotBackClicked()
839 if ( _sendButtonEvents )
840 YQUI::ui()->sendEvent( new YWidgetEvent( _backButton, YEvent::Activated ) );
842 _direction = YQWizard::Backward;
846 void YQWizard::slotAbortClicked()
850 if ( _sendButtonEvents )
851 YQUI::ui()->sendEvent( new YWidgetEvent( _abortButton, YEvent::Activated ) );
855 void YQWizard::slotNextClicked()
859 if ( _sendButtonEvents )
860 YQUI::ui()->sendEvent( new YWidgetEvent( _nextButton, YEvent::Activated ) );
862 _direction = YQWizard::Forward;
866 void YQWizard::showHelp()
868 QDialog helpDlg( this );
870 ui.setupUi( &helpDlg );
871 ui.textBrowser->setText( _qHelpText );
876 void YQWizard::releaseNotesClicked()
878 YQUI::ui()->sendEvent( new YWidgetEvent( _nextButton, YEvent::Activated ) );
880 if ( ! _releaseNotesButtonId.empty() )
882 y2milestone( "Release Notes button clicked" );
883 sendEvent( _releaseNotesButtonId );
888 void YQWizard::showSteps()
890 if ( _sideBar && _stepsPanel )
892 _sideBar->setCurrentWidget( _stepsPanel );
897 void YQWizard::showTree()
899 if ( _sideBar && _treePanel )
901 _sideBar->setCurrentWidget( _treePanel );
907 void YQWizard::addMenu( const string & text,
912 QMenu * menu = new QMenu( _menuBar );
913 YUI_CHECK_NEW( menu );
915 _menuIDs.insert( fromUTF8( id ), menu );
916 //FIXME _menuBar->insertItem( fromUTF8( text ), menu );
918 connect( menu, SIGNAL( activated ( int ) ),
919 this, SLOT ( sendMenuEvent( int ) ) );
926 void YQWizard::addSubMenu( const string & parentMenuID,
930 QMenu* parentMenu = _menuIDs[ fromUTF8( parentMenuID ) ];
934 QMenu * menu = new QMenu( _menuBar );
935 YUI_CHECK_NEW( menu );
937 _menuIDs.insert( fromUTF8( id ), menu );
938 //FIXME parentMenu->insertItem( fromUTF8( text ), menu );
940 connect( menu, SIGNAL( activated ( int ) ),
941 this, SLOT ( sendMenuEvent( int ) ) );
945 y2error( "Can't find menu with ID %s", parentMenuID.c_str() );
950 void YQWizard::addMenuEntry( const string & parentMenuID,
952 const string & idString )
954 QMenu * parentMenu = _menuIDs[ fromUTF8( parentMenuID ) ];
958 int id = _menuEntryIDs.size();
959 _menuEntryIDs.push_back( idString );
960 //FIXME parentMenu->insertItem( fromUTF8( text ), id );
964 y2error( "Can't find menu with ID %s", parentMenuID.c_str() );
969 void YQWizard::addMenuSeparator( const string & parentMenuID )
971 QMenu * parentMenu = _menuIDs[ fromUTF8( parentMenuID ) ];
975 parentMenu->addSeparator();
979 y2error( "Can't find menu with ID %s", parentMenuID.c_str() );
984 void YQWizard::deleteMenus()
991 _menuEntryIDs.clear();
996 void YQWizard::sendMenuEvent( int numID )
998 if ( numID >= 0 && numID < (int) _menuEntryIDs.size() )
1000 sendEvent( _menuEntryIDs[ numID ] );
1004 y2error( "Invalid menu ID: %d", numID );
1009 void YQWizard::sendEvent( const string & id )
1011 YQUI::ui()->sendEvent( new YMenuEvent( id ) );
1015 int YQWizard::preferredWidth()
1017 return sizeHint().width();
1021 int YQWizard::preferredHeight()
1023 return sizeHint().height();
1027 void YQWizard::setSize( int newWidth, int newHeight )
1029 resize( newWidth, newHeight );
1035 void YQWizard::resizeClientArea()
1037 y2debug( "resizing client area" );
1038 QRect contentsRect = _clientArea->contentsRect();
1039 _contents->setSize( contentsRect.width(), contentsRect.height() );
1042 bool YQWizard::eventFilter( QObject * obj, QEvent * ev )
1044 if ( ev->type() == QEvent::Resize && obj == _contents )
1047 return true; // Event handled
1050 return QWidget::eventFilter( obj, ev );
1054 void YQWizard::setButtonLabel( YPushButton * button, const string & newLabel )
1056 button->setLabel( newLabel );
1057 YDialog::currentDialog()->checkShortcuts();
1059 YQWizardButton * wizardButton = dynamic_cast<YQWizardButton *> (button);
1062 wizardButton->setVisible( !newLabel.empty() );
1066 void YQWizard::showReleaseNotesButton( const string & label, const string & id )
1068 return; // no longer supported!
1070 if ( ! _releaseNotesButton )
1072 y2error( "NULL Release Notes button" );
1074 if ( ! _stepsPanel )
1075 y2error( "This works only if there is a \"steps\" panel!" );
1080 // no way to check the shortcut, so strip it
1081 _releaseNotesButton->setText( fromUTF8( YShortcut::cleanShortcutString( label ) ) );
1082 _releaseNotesButtonId = id;
1084 _releaseNotesButton->show();
1088 void YQWizard::hideReleaseNotesButton()
1090 if ( _releaseNotesButton && !_releaseNotesButton->isHidden() )
1091 _releaseNotesButton->hide();
1095 void YQWizard::retranslateInternalButtons()
1097 YQUI::setTextdomain( TEXTDOMAIN );
1100 // "Help" button - intentionally without keyboard shortcut
1101 _helpButton->setText( _( "Help" ) );
1104 // "Steps" button - intentionally without keyboard shortcut
1105 _stepsButton->setText( _( "Steps" ) );
1108 // "Tree" button - intentionally without keyboard shortcut
1109 _treeButton->setText( _( "Tree" ) );
1113 void YQWizard::Step::deleteLabels()
1115 delete _statusLabel;
1121 YQWizard::Step::~Step()
1126 void YQWizard::Step::setStatus( Status s )
1128 if ( !_statusLabel || !_nameLabel || _status == s )
1135 _statusLabel->setProperty( "class", "todo-step-status QLabel" );
1136 _nameLabel->setProperty( "class", "todo-step-name QLabel" );
1141 _statusLabel->setProperty( "class", "done-step-status QLabel" );
1142 _nameLabel->setProperty( "class", "done-step-name QLabel" );
1147 _statusLabel->setProperty( "class", "current-step-status QLabel" );
1148 _nameLabel->setProperty( "class", "current-step-name QLabel" );
1151 qApp->style()->polish( _statusLabel );
1152 qApp->style()->polish( _nameLabel );
1155 #include "YQWizard.moc"