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
189 QVBoxLayout *vbox = new QVBoxLayout( );
190 vbox->addWidget( _sideBar );
197 else if ( _stepsEnabled )
207 void YQWizard::layoutStepsPanel()
210 _stepsPanel = new QFrame( _sideBar );
211 _sideBar->addWidget( _stepsPanel );
212 _sideBar->setObjectName( "steps" );
213 QY2Styler::self()->registerWidget( _sideBar );
214 _stepsPanel->setProperty( "class", "steps QFrame" );
216 // Steps panel bottom buttons ("Help", "Release Notes")
218 // Layouts for the buttons
220 _releaseNotesButton = new QPushButton( _( "Release Notes..." ), _stepsPanel );
221 _releaseNotesButton->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Minimum ) ); // hor/vert
223 connect( _releaseNotesButton, SIGNAL( clicked() ),
224 this, SLOT ( releaseNotesClicked() ) );
226 _releaseNotesButton->hide(); // hidden until showReleaseNotesButton() is called
228 _stepsDirty = true; // no layout yet
233 void YQWizard::addStep( const string & text, const string & id )
235 QString qId = fromUTF8( id );
237 if ( _stepsIDs[ qId ] )
239 y2error( "Step ID \"%s\" (\"%s\") already used for \"%s\"",
242 qPrintable( _stepsIDs[ qId ]->name() ) );
246 if ( _stepsList.last() && _stepsList.last()->name() == fromUTF8( text ) )
248 // Consecutive steps with the same name will be shown as one single step.
250 // Since steps are always added at the end of the list, it is
251 // sufficient to check the last step of the list. If the texts are the
252 // same, the other with the same text needs to get another (additional)
253 // ID to make sure setCurrentStep() works as it should.
254 _stepsList.last()->addID( qId );
258 _stepsList.append( new YQWizard::Step( fromUTF8( text ), qId ) );
262 _stepsIDs.insert( qId, _stepsList.last() );
267 void YQWizard::addStepHeading( const string & text )
269 _stepsList.append( new YQWizard::StepHeading( fromUTF8( text ) ) );
275 void YQWizard::updateSteps()
280 // Create a grid layout for the steps
281 delete _stepsPanel->layout();
282 QVBoxLayout *_stepsVBox = new QVBoxLayout( _stepsPanel );
284 QGridLayout *_stepsGrid = new QGridLayout( );
285 YUI_CHECK_NEW( _stepsGrid );
286 _stepsVBox->addLayout( _stepsGrid );
287 _stepsGrid->setColumnMinimumWidth( 0, 10 );
288 _stepsGrid->setRowStretch( 0, 1 );
289 _stepsGrid->setRowStretch( 1, 1 );
290 _stepsGrid->setRowStretch( 2, 99 );
292 const int statusCol = 1;
293 const int nameCol = 2;
298 // Create widgets for all steps and step headings in the internal list
301 for ( QList<Step*>::iterator i = _stepsList.begin(); i != _stepsList.end(); ++i)
303 YQWizard::Step * step = *i;
305 step->deleteLabels();
307 if ( step->isHeading() )
313 QLabel * label = new QLabel( step->name(), _stepsPanel );
314 YUI_CHECK_NEW( label );
315 label->setAlignment( Qt::AlignLeft | Qt::AlignTop );
316 label->setProperty( "class", "steps_heading" );
318 step->setNameLabel( label );
319 _stepsGrid->addWidget( label,
321 1, nameCol - statusCol + 1);
323 else // No heading - ordinary step
329 QLabel * statusLabel = new QLabel( _stepsPanel );
330 YUI_CHECK_NEW( statusLabel );
332 step->setStatusLabel( statusLabel );
333 statusLabel->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum );
334 _stepsGrid->addWidget( statusLabel, row, statusCol );
340 QLabel * nameLabel = new QLabel( step->name(), _stepsPanel );
341 YUI_CHECK_NEW( nameLabel );
342 nameLabel->setAlignment( Qt::AlignLeft | Qt::AlignTop );
344 step->setNameLabel( nameLabel );
345 _stepsGrid->addWidget( nameLabel, row, nameCol );
351 _stepsVBox->addStretch( 99 );
352 QVBoxLayout *rbl = new QVBoxLayout();
353 rbl->addWidget( _releaseNotesButton, 0, Qt::AlignCenter );
355 _stepsVBox->addLayout( rbl );
356 _stepsVBox->addStretch( 29 );
362 void YQWizard::updateStepStates()
367 YQWizard::Step * currentStep = findStep( _currentStepID );
368 QList<YQWizard::Step*>::iterator step = _stepsList.begin();
372 // Set status icon and color for the current step
373 currentStep->setStatus( Step::Current );
376 // Set all steps before the current to "done"
379 while ( step != _stepsList.end() && *step != currentStep )
381 ( *step )->setStatus( Step::Done );
385 // Skip the current step - continue with the step after it
387 if ( step != _stepsList.end() )
392 // Set all steps after the current to "to do"
395 while ( step != _stepsList.end() )
397 ( *step )->setStatus( Step::Todo );
402 void YQWizard::setCurrentStep( const string & id )
404 _currentStepID = fromUTF8( id );
409 void YQWizard::deleteSteps()
411 qDeleteAll(_stepsList);
417 YQWizard::Step * YQWizard::findStep( const QString & id )
422 return _stepsIDs[ id ];
426 void YQWizard::layoutTreePanel()
428 _treePanel = new QFrame( _sideBar );
429 YUI_CHECK_NEW( _treePanel );
430 QHBoxLayout *layout = new QHBoxLayout( _treePanel );
431 _sideBar->addWidget( _treePanel );
433 QVBoxLayout * vbox = new QVBoxLayout();
434 YUI_CHECK_NEW( vbox );
435 layout->addLayout( vbox );
439 _tree = new QY2ListView( _treePanel );
440 YUI_CHECK_NEW( _tree );
441 vbox->addWidget( _tree );
444 // _tree->addColumn( "" );
445 // _tree->header()->hide();
447 _tree->setRootIsDecorated( true );
448 _tree->setSortByInsertionSequence( true );
450 connect( _tree, SIGNAL( itemSelectionChanged ( void ) ),
451 this, SLOT ( treeSelectionChanged ( void ) ) );
453 connect( _tree, SIGNAL( itemActivated ( QTreeWidgetItem *, int ) ),
454 this, SLOT ( sendTreeEvent ( QTreeWidgetItem * ) ) );
456 connect( _tree, SIGNAL( itemDoubleClicked ( QTreeWidgetItem *, int ) ),
457 this, SLOT ( sendTreeEvent ( QTreeWidgetItem * ) ) );
462 void YQWizard::addTreeItem( const string & parentID, const string & text, const string & id )
464 QString qId = fromUTF8( id );
468 y2error( "YQWizard widget not created with `opt(`treeEnabled) !" );
472 YQWizard::TreeItem * item = 0;
473 YQWizard::TreeItem * parent = 0;
475 if ( ! parentID.empty() )
477 parent = findTreeItem( parentID );
482 item = new YQWizard::TreeItem( parent, fromUTF8( text ), qId );
483 YUI_CHECK_NEW( item );
487 item = new YQWizard::TreeItem( _tree, fromUTF8( text ), qId );
488 YUI_CHECK_NEW( item );
491 if ( ! qId.isEmpty() )
492 _treeIDs.insert( qId, item );
497 void YQWizard::deleteTreeItems()
507 YQWizard::TreeItem * YQWizard::findTreeItem( const string & id )
512 return _treeIDs[ fromUTF8( id ) ];
516 void YQWizard::selectTreeItem( const string & id )
520 YQWizard::TreeItem * item = findTreeItem( id );
524 YQSignalBlocker sigBlocker( _tree );
526 _tree->setCurrentItem(item);
527 _tree->scrollToItem(item);
533 void YQWizard::sendTreeEvent( QTreeWidgetItem * listViewItem )
537 YQWizard::TreeItem * item = dynamic_cast<YQWizard::TreeItem *> ( listViewItem );
539 if ( item && ! item->id().isEmpty() )
540 sendEvent( toUTF8( item->id() ) );
545 void YQWizard::treeSelectionChanged()
546 { //FIXME is currentItem correct or selected.first
548 sendTreeEvent( _tree->currentItem() );
552 string YQWizard::currentTreeSelection()
556 QTreeWidgetItem * sel = _tree->currentItem();
560 YQWizard::TreeItem * item = dynamic_cast<YQWizard::TreeItem *> (sel);
562 if ( item && ! item->id().isEmpty() )
563 return toUTF8( item->id() );
572 QWidget *YQWizard::layoutWorkArea( QWidget * parent )
574 QFrame *workArea = new QFrame( parent );
575 workArea->setObjectName( "work_area" );
577 QY2Styler::self()->registerWidget( workArea );
579 QVBoxLayout *vbox = new QVBoxLayout( workArea );
581 _menuBar = new QMenuBar( workArea );
582 YUI_CHECK_NEW( _menuBar );
584 _menuBar->hide(); // will be made visible when menus are added
585 vbox->addWidget( _menuBar );
588 // Dialog icon and heading
591 QHBoxLayout * headingHBox = new QHBoxLayout();
592 YUI_CHECK_NEW( headingHBox );
593 //headingHBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ) ); // hor/vert
594 vbox->addLayout( headingHBox );
596 _dialogIcon = new QLabel( workArea );
597 YUI_CHECK_NEW( _dialogIcon );
598 headingHBox->addWidget( _dialogIcon );
599 _dialogIcon->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ) ); // hor/vert
600 _dialogIcon->setObjectName( "DialogIcon" );
602 _dialogHeading = new QLabel( workArea );
603 YUI_CHECK_NEW( _dialogHeading );
604 headingHBox->addWidget( _dialogHeading );
605 _dialogHeading->setAlignment( Qt::AlignLeft );
606 _dialogHeading->setWordWrap( true );
607 _dialogHeading->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ) ); // hor/vert
608 _dialogHeading->setObjectName( "DialogHeading" );
611 // Client area (the part that belongs to the YCP application)
614 layoutClientArea( workArea );
615 vbox->addWidget( _clientArea );
621 QLayout *bb = layoutButtonBox( workArea );
622 vbox->addLayout( bb );
629 void YQWizard::layoutClientArea( QWidget * parent )
631 _clientArea = new QFrame( parent );
632 YUI_CHECK_NEW( _clientArea );
633 _clientArea->setObjectName("_clientArea");
634 QVBoxLayout *layout = new QVBoxLayout( _clientArea );
635 layout->setMargin( 0 );
638 // HVCenter for wizard contents
641 _contents = new YQAlignment( this, _clientArea, YAlignCenter, YAlignCenter );
642 YUI_CHECK_NEW( _contents );
643 layout->addWidget( _contents );
644 _contents->QObject::setProperty( "class", "Contents" );
646 _contents->setStretchable( YD_HORIZ, true );
647 _contents->setStretchable( YD_VERT, true );
648 _contents->installEventFilter( this );
649 _contents->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) ); // hor/vert
652 // Replace point for wizard contents
655 _contentsReplacePoint = YUI::widgetFactory()->createReplacePoint( _contents );
658 // Initial YEmpty widget contents of replace point
661 YUI::widgetFactory()->createEmpty( _contentsReplacePoint );
662 _contentsReplacePoint->showChild();
668 QLayout *YQWizard::layoutButtonBox( QWidget * parent )
671 // QHBoxLayout for the buttons
674 QHBoxLayout * hbox = new QHBoxLayout(); // parent, spacing
675 YUI_CHECK_NEW( hbox );
677 hbox->setSpacing( 0 );
678 hbox->setMargin( 0 );
680 // Help button - intentionally without keyboard shortcut
681 _helpButton = new QPushButton( _( "Help" ), parent );
682 YUI_CHECK_NEW( _helpButton );
684 connect( _helpButton, SIGNAL( clicked() ),
685 this, SLOT ( showHelp() ) );
687 hbox->addWidget( _helpButton );
689 hbox->addStretch( 10 );
695 _abortButton = new YQWizardButton( this, parent, _abortButtonLabel );
696 YUI_CHECK_NEW( _abortButton );
698 hbox->addWidget( (QWidget *) _abortButton->widgetRep() );
699 connect( _abortButton, SIGNAL( clicked() ),
700 this, SLOT ( slotAbortClicked() ) );
702 hbox->addSpacing( 10 );
708 _backButton = new YQWizardButton( this, parent, _backButtonLabel );
709 YUI_CHECK_NEW( _backButton );
711 hbox->addWidget( (QWidget *) _backButton->widgetRep() );
712 connect( _backButton, SIGNAL( clicked() ),
713 this, SLOT ( slotBackClicked() ) );
715 if ( _backButton->text().isEmpty() )
722 hbox->addSpacing( 5 );
724 _nextButton = new YQWizardButton( this, parent, _nextButtonLabel );
725 YUI_CHECK_NEW( _nextButton );
727 hbox->addWidget( (QWidget *) _nextButton->widgetRep() );
728 connect( _nextButton, SIGNAL( clicked() ),
729 this, SLOT ( slotNextClicked() ) );
734 void YQWizard::destroyButtons()
747 void YQWizard::connectNotify ( const char * signal )
749 if ( QString( signal ).contains( "nextClicked()" ) )
751 y2debug( "nextClicked connected, no longer directly sending button events" );
752 _sendButtonEvents = false;
757 void YQWizard::disconnectNotify ( const char * signal )
759 if ( QString( signal ).contains( "nextClicked()" ) )
761 y2debug( "nextClicked disconnected, directly sending button events again" );
762 _sendButtonEvents = true;
767 void YQWizard::setDialogIcon( const string & iconName )
771 if ( ! iconName.empty() )
773 QPixmap icon( iconName.c_str() );
776 y2warning( "Couldn't load dialog icon \"%s\"", iconName.c_str() );
779 _dialogIcon->setPixmap( icon );
780 topLevelWidget()->setWindowIcon( icon );
785 _dialogIcon->clear();
786 topLevelWidget()->setWindowIcon( QIcon() );
792 void YQWizard::setDialogHeading( const string & headingText )
794 if ( _dialogHeading )
796 if ( ! headingText.empty() )
797 _dialogHeading->setText( fromUTF8( headingText ) );
799 _dialogHeading->clear();
803 string YQWizard::debugLabel()
805 if ( _dialogHeading )
807 QString label = _dialogHeading->text();
808 label = label.simplified(); // Replace any embedded newline with a single blank
810 if ( ! label.isEmpty() )
812 label.prepend( "YQWizard \"" );
813 label.append( "\"" );
815 return toUTF8( label );
819 return "untitled YQWizard";
822 void YQWizard::setHelpText( const string & helpText )
824 _qHelpText = fromUTF8( helpText );
825 _qHelpText.replace( "&product;", YQUI::ui()->productName() );
829 void YQWizard::slotBackClicked()
833 if ( _sendButtonEvents )
834 YQUI::ui()->sendEvent( new YWidgetEvent( _backButton, YEvent::Activated ) );
836 _direction = YQWizard::Backward;
840 void YQWizard::slotAbortClicked()
844 if ( _sendButtonEvents )
845 YQUI::ui()->sendEvent( new YWidgetEvent( _abortButton, YEvent::Activated ) );
849 void YQWizard::slotNextClicked()
853 if ( _sendButtonEvents )
854 YQUI::ui()->sendEvent( new YWidgetEvent( _nextButton, YEvent::Activated ) );
856 _direction = YQWizard::Forward;
860 void YQWizard::showHelp()
862 QDialog helpDlg( this );
864 ui.setupUi( &helpDlg );
865 ui.textBrowser->setText( _qHelpText );
870 void YQWizard::releaseNotesClicked()
872 YQUI::ui()->sendEvent( new YWidgetEvent( _nextButton, YEvent::Activated ) );
874 if ( ! _releaseNotesButtonId.empty() )
876 y2milestone( "Release Notes button clicked" );
877 sendEvent( _releaseNotesButtonId );
882 void YQWizard::showSteps()
884 if ( _sideBar && _stepsPanel )
886 _sideBar->setCurrentWidget( _stepsPanel );
891 void YQWizard::showTree()
893 if ( _sideBar && _treePanel )
895 _sideBar->setCurrentWidget( _treePanel );
901 void YQWizard::addMenu( const string & text,
906 QMenu * menu = new QMenu( _menuBar );
907 YUI_CHECK_NEW( menu );
909 _menuIDs.insert( fromUTF8( id ), menu );
910 //FIXME _menuBar->insertItem( fromUTF8( text ), menu );
912 connect( menu, SIGNAL( activated ( int ) ),
913 this, SLOT ( sendMenuEvent( int ) ) );
920 void YQWizard::addSubMenu( const string & parentMenuID,
924 QMenu* parentMenu = _menuIDs[ fromUTF8( parentMenuID ) ];
928 QMenu * menu = new QMenu( _menuBar );
929 YUI_CHECK_NEW( menu );
931 _menuIDs.insert( fromUTF8( id ), menu );
932 //FIXME parentMenu->insertItem( fromUTF8( text ), menu );
934 connect( menu, SIGNAL( activated ( int ) ),
935 this, SLOT ( sendMenuEvent( int ) ) );
939 y2error( "Can't find menu with ID %s", parentMenuID.c_str() );
944 void YQWizard::addMenuEntry( const string & parentMenuID,
946 const string & idString )
948 QMenu * parentMenu = _menuIDs[ fromUTF8( parentMenuID ) ];
952 int id = _menuEntryIDs.size();
953 _menuEntryIDs.push_back( idString );
954 //FIXME parentMenu->insertItem( fromUTF8( text ), id );
958 y2error( "Can't find menu with ID %s", parentMenuID.c_str() );
963 void YQWizard::addMenuSeparator( const string & parentMenuID )
965 QMenu * parentMenu = _menuIDs[ fromUTF8( parentMenuID ) ];
969 parentMenu->addSeparator();
973 y2error( "Can't find menu with ID %s", parentMenuID.c_str() );
978 void YQWizard::deleteMenus()
985 _menuEntryIDs.clear();
990 void YQWizard::sendMenuEvent( int numID )
992 if ( numID >= 0 && numID < (int) _menuEntryIDs.size() )
994 sendEvent( _menuEntryIDs[ numID ] );
998 y2error( "Invalid menu ID: %d", numID );
1003 void YQWizard::sendEvent( const string & id )
1005 YQUI::ui()->sendEvent( new YMenuEvent( id ) );
1009 int YQWizard::preferredWidth()
1011 return sizeHint().width();
1015 int YQWizard::preferredHeight()
1017 return sizeHint().height();
1021 void YQWizard::setSize( int newWidth, int newHeight )
1023 resize( newWidth, newHeight );
1029 void YQWizard::resizeClientArea()
1031 y2debug( "resizing client area" );
1032 QRect contentsRect = _clientArea->contentsRect();
1033 _contents->setSize( contentsRect.width(), contentsRect.height() );
1036 bool YQWizard::eventFilter( QObject * obj, QEvent * ev )
1038 if ( ev->type() == QEvent::Resize && obj == _contents )
1041 return true; // Event handled
1044 return QWidget::eventFilter( obj, ev );
1048 void YQWizard::setButtonLabel( YPushButton * button, const string & newLabel )
1050 button->setLabel( newLabel );
1051 YDialog::currentDialog()->checkShortcuts();
1053 YQWizardButton * wizardButton = dynamic_cast<YQWizardButton *> (button);
1056 wizardButton->setVisible( !newLabel.empty() );
1060 void YQWizard::showReleaseNotesButton( const string & label, const string & id )
1062 return; // no longer supported!
1064 if ( ! _releaseNotesButton )
1066 y2error( "NULL Release Notes button" );
1068 if ( ! _stepsPanel )
1069 y2error( "This works only if there is a \"steps\" panel!" );
1074 // no way to check the shortcut, so strip it
1075 _releaseNotesButton->setText( fromUTF8( YShortcut::cleanShortcutString( label ) ) );
1076 _releaseNotesButtonId = id;
1078 _releaseNotesButton->show();
1082 void YQWizard::hideReleaseNotesButton()
1084 if ( _releaseNotesButton && !_releaseNotesButton->isHidden() )
1085 _releaseNotesButton->hide();
1089 void YQWizard::retranslateInternalButtons()
1091 YQUI::setTextdomain( TEXTDOMAIN );
1094 // "Help" button - intentionally without keyboard shortcut
1095 _helpButton->setText( _( "Help" ) );
1098 // "Steps" button - intentionally without keyboard shortcut
1099 _stepsButton->setText( _( "Steps" ) );
1102 // "Tree" button - intentionally without keyboard shortcut
1103 _treeButton->setText( _( "Tree" ) );
1107 void YQWizard::Step::deleteLabels()
1109 delete _statusLabel;
1116 void YQWizard::Step::setStatus( Status s )
1118 if ( !_statusLabel || !_nameLabel || _status == s )
1125 _statusLabel->setProperty( "class", "todo-step-status QLabel" );
1126 _nameLabel->setProperty( "class", "todo-step-name QLabel" );
1131 _statusLabel->setProperty( "class", "done-step-status QLabel" );
1132 _nameLabel->setProperty( "class", "done-step-name QLabel" );
1137 _statusLabel->setProperty( "class", "current-step-status QLabel" );
1138 _nameLabel->setProperty( "class", "current-step-name QLabel" );
1141 qApp->style()->polish( _statusLabel );
1142 qApp->style()->polish( _nameLabel );
1145 #include "YQWizard.moc"