libyui-qt
Loading...
Searching...
No Matches
YQWizard Class Reference
Inheritance diagram for YQWizard:
Collaboration diagram for YQWizard:

Classes

class  Step
 
class  StepHeading
 
class  TreeItem
 

Public Types

enum  Direction { Forward , Backward }
 

Public Slots

void resizeClientArea ()
 
void showHelp ()
 
void showHotkeys ()
 
void showSteps ()
 
void showTree ()
 

Signals

void backClicked ()
 
void abortClicked ()
 
void nextClicked ()
 

Public Member Functions

 YQWizard (YWidget *parent, const std::string &backButtonLabel, const std::string &abortButtonLabel, const std::string &nextButtonLabel, YWizardMode wizardMode=YWizardMode_Standard)
 
virtual ~YQWizard ()
 
virtual std::string debugLabel () const
 
Direction direction () const
 
virtual YQWizardButtonbackButton () const
 
virtual YQWizardButtonabortButton () const
 
virtual YQWizardButtonnextButton () const
 
virtual YReplacePoint * contentsReplacePoint () const
 
virtual void setButtonLabel (YPushButton *button, const std::string &newLabel)
 
virtual void setHelpText (const std::string &helpText)
 
virtual void setDialogIcon (const std::string &iconName)
 
virtual void setDialogTitle (const std::string &titleText)
 
virtual std::string getDialogTitle ()
 
virtual void setDialogHeading (const std::string &headingText)
 
virtual std::string getDialogHeading ()
 
virtual void addStep (const std::string &text, const std::string &id)
 
virtual void addStepHeading (const std::string &text)
 
QList< YQWizard::Step * > stepsList ()
 
void copySteps (YQWizard *wizard)
 
virtual void deleteSteps ()
 
virtual void setCurrentStep (const std::string &id)
 
QString currentStep ()
 
virtual void updateSteps ()
 
virtual void addTreeItem (const std::string &parentID, const std::string &text, const std::string &id)
 
virtual void selectTreeItem (const std::string &id)
 
virtual std::string currentTreeSelection ()
 
virtual void deleteTreeItems ()
 
virtual void addMenu (const std::string &text, const std::string &id)
 
virtual void addSubMenu (const std::string &parentMenuID, const std::string &text, const std::string &id)
 
virtual void addMenuEntry (const std::string &parentMenuID, const std::string &text, const std::string &id)
 
virtual void addMenuSeparator (const std::string &parentMenuID)
 
virtual void deleteMenus ()
 
virtual void showReleaseNotesButton (const std::string &label, const std::string &id)
 
virtual void hideReleaseNotesButton ()
 
virtual void retranslateInternalButtons ()
 
virtual bool eventFilter (QObject *obj, QEvent *ev)
 
QWidget * workArea () const
 
virtual int preferredWidth ()
 
virtual int preferredHeight ()
 
virtual void setSize (int newWidth, int newHeight)
 
bool isSecondary () const
 

Protected Slots

void slotBackClicked ()
 
void slotAbortClicked ()
 
void slotNextClicked ()
 
void showReleaseNotes ()
 
void sendTreeEvent (QTreeWidgetItem *item)
 
void treeSelectionChanged ()
 
void sendMenuEvent (QAction *action)
 
void askForWidgetStyle ()
 

Protected Member Functions

void layoutTitleBar (QWidget *parent)
 
QLayout * layoutSideBar (QWidget *parent)
 
void layoutSideBarButtonBox (QWidget *parent, QPushButton *button)
 
void layoutStepsPanel ()
 
void layoutTreePanel ()
 
QWidget * layoutWorkArea (QWidget *parent)
 
void layoutClientArea (QWidget *parent)
 
QLayout * layoutButtonBox (QWidget *parent)
 
QToolButton * addStyleButton (QWidget *parent)
 
bool titleIsOnTheLeft () const
 
bool useBanner () const
 
void destroyButtons ()
 
void updateStepStates ()
 
void sendEvent (const std::string &id)
 
void connectNotify (const char *signal)
 
void disconnectNotify (const char *signal)
 
void setButtonLabel (YQWizardButton *button, const QString &newLabel)
 
void enableButton (YQWizardButton *button, bool enabled)
 
void setButtonFocus (YQWizardButton *button)
 
YQWizard::StepfindStep (const QString &id)
 
YQWizard::TreeItemfindTreeItem (const std::string &id)
 

Protected Attributes

std::string _backButtonLabel
 
std::string _abortButtonLabel
 
std::string _nextButtonLabel
 
bool _stepsEnabled
 
bool _stepsRegistered
 
bool _treeEnabled
 
bool _protectNextButton
 
bool _stepsDirty
 
bool _sendButtonEvents
 
bool _forceBanner
 
bool _forceTitleLeft
 
Direction _direction
 
QString _currentStepID
 
QString _qHelpText
 
QString _qHotkeysText
 
QY2HelpDialog_helpDialog
 
QY2HelpDialog_hotkeysDialog
 
QY2RelNotesDialog_relNotesDialog
 
QStackedWidget * _sideBar
 
QWidget * _stepsPanel
 
YQWizardButton_releaseNotesButton
 
YQWizardButton_helpButton
 
QAction * _helpAction
 
QAction * _hotkeysAction
 
QPushButton * _stepsButton
 
QPushButton * _treeButton
 
QFrame * _treePanel
 
QY2ListView_tree
 
YQStyleButtonPos _styleButtonPos
 
QToolButton * _styleButton
 
QToolButton * _styleButton2
 
QFrame * _workArea
 
QWidget * _clientArea
 
QMenuBar * _menuBar
 
QLabel * _dialogIcon
 
QLabel * _dialogLogo
 
QLabel * _dialogBanner
 
QLabel * _dialogHeading
 
YQAlignment_contents
 
YQWizardButton_backButton
 
YQWizardButton_abortButton
 
YQWizardButton_nextButton
 
YReplacePoint * _contentsReplacePoint
 
QList< YQWizard::Step * > _stepsList
 
QHash< QString, YQWizard::Step * > _stepsIDs
 
QHash< QString, YQWizard::TreeItem * > _treeIDs
 
QHash< QString, QMenu * > _menuIDs
 
QHash< QAction *, std::string > _menuEntryIDs
 
QIcon _previousWindowIcon
 

Static Protected Attributes

static std::string _releaseNotesButtonId = ""
 
static std::string _releaseNotesButtonLabel = ""
 

Constructor & Destructor Documentation

◆ YQWizard()

YQWizard::YQWizard ( YWidget * parent,
const std::string & backButtonLabel,
const std::string & abortButtonLabel,
const std::string & nextButtonLabel,
YWizardMode wizardMode = YWizardMode_Standard )

Constructor.

◆ ~YQWizard()

YQWizard::~YQWizard ( )
virtual

Destructor.

Member Function Documentation

◆ abortClicked

void YQWizard::abortClicked ( )
signal

Emitted when the "Abort" button is clicked.

◆ addMenu()

void YQWizard::addMenu ( const std::string & text,
const std::string & id )
virtual

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.

◆ addMenuEntry()

void YQWizard::addMenuEntry ( const std::string & parentMenuID,
const std::string & text,
const std::string & id )
virtual

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.

◆ addMenuSeparator()

void YQWizard::addMenuSeparator ( const std::string & parentMenuID)
virtual

Add a menu separator to a menu.

Implemented from YWizard.

◆ addStep()

void YQWizard::addStep ( const std::string & text,
const std::string & id )
virtual

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.

◆ addStepHeading()

void YQWizard::addStepHeading ( const std::string & text)
virtual

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.

◆ addSubMenu()

void YQWizard::addSubMenu ( const std::string & parentMenuID,
const std::string & text,
const std::string & id )
virtual

Add a submenu to the menu with ID 'parentMenuID'.

Implemented from YWizard.

◆ addTreeItem()

void YQWizard::addTreeItem ( const std::string & parentID,
const std::string & text,
const std::string & id )
virtual

Add a tree item. If "parentID" is an empty std::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.

◆ askForWidgetStyle

void YQWizard::askForWidgetStyle ( )
protectedslot

Open a pop-up to let the user choose from any of the available QSS widget style sheets of the theme directory.

◆ backButton()

virtual YQWizardButton * YQWizard::backButton ( ) const
inlinevirtual

Return internal widgets.

Implemented from YWizard.

◆ backClicked

void YQWizard::backClicked ( )
signal

Emitted when the "Back" or "Cancel" button is clicked.

◆ connectNotify()

void YQWizard::connectNotify ( const char * signal)
protected

Notification that a signal is being connected.

Reimplemented from QObject.

◆ copySteps()

void YQWizard::copySteps ( YQWizard * wizard)

Create a copy of given wizard's steps set (names & IDs) Populates _stepsList structure of current wizard

◆ currentStep()

QString YQWizard::currentStep ( )
inline

Return QString ID of currently active step

◆ currentTreeSelection()

string YQWizard::currentTreeSelection ( )
virtual

Returns the current tree selection or an empty std::string if nothing is selected or there is no tree.

Implemented from YWizard.

◆ debugLabel()

string YQWizard::debugLabel ( ) const
virtual

Returns a descriptive label of this dialog instance for debugging.

Reimplemented from YWidget.

◆ deleteMenus()

void YQWizard::deleteMenus ( )
virtual

Delete all menus and hide the menu bar.

Implemented from YWizard.

◆ deleteSteps()

void YQWizard::deleteSteps ( )
virtual

Delete all steps and step headings from the internal lists. The display is only updated upon calling updateSteps().

Implemented from YWizard.

◆ deleteTreeItems()

void YQWizard::deleteTreeItems ( )
virtual

Delete all tree items.

Implemented from YWizard.

◆ destroyButtons()

void YQWizard::destroyButtons ( )
protected

Destroy the button box's buttons

◆ direction()

Direction YQWizard::direction ( ) const
inline

Returns the current direction of wizard operations - going forward or going backward. This can be used to maintain a consistent direction when assigning default buttons to a dialog.

◆ disconnectNotify()

void YQWizard::disconnectNotify ( const char * signal)
protected

Notification that a signal is being disconnected.

Reimplemented from QObject.

◆ enableButton()

void YQWizard::enableButton ( YQWizardButton * button,
bool enabled )
protected

Enable or disable a button.

◆ eventFilter()

bool YQWizard::eventFilter ( QObject * obj,
QEvent * ev )
virtual

Event filter.

Reimplemented from QWidget.

◆ findStep()

YQWizard::Step * YQWizard::findStep ( const QString & id)
protected

Find a step with the specified ID. Returns 0 if there is no such step.

◆ findTreeItem()

YQWizard::TreeItem * YQWizard::findTreeItem ( const std::string & id)
protected

Find a tree item with the specified ID. Tree items without IDs cannot be found at all. Returns the item or 0 if no such item found.

◆ getDialogHeading()

string YQWizard::getDialogHeading ( )
virtual

Get the dialog heading.

Implemented from YWizard.

◆ getDialogTitle()

string YQWizard::getDialogTitle ( )
virtual

Get the current dialog title shown in the window manager's title bar.

Implemented from YWizard.

◆ hideReleaseNotesButton()

void YQWizard::hideReleaseNotesButton ( )
virtual

Hide an existing "Release Notes" button.

Implemented from YWizard.

◆ isSecondary()

bool YQWizard::isSecondary ( ) const

Returns true if the wizard should follow the first wizard with steps

◆ nextClicked

void YQWizard::nextClicked ( )
signal

Emitted when the "Next" or "OK" button is clicked.

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.

◆ preferredHeight()

int YQWizard::preferredHeight ( )
virtual

Preferred height of the widget.

Reimplemented from YWidget.

◆ preferredWidth()

int YQWizard::preferredWidth ( )
virtual

Preferred width of the widget.

Reimplemented from YWidget.

◆ resizeClientArea

void YQWizard::resizeClientArea ( )
slot

Adapt the size of the client area (the ReplacePoint(Id(:contents)) to fit in its current space.

◆ retranslateInternalButtons()

void YQWizard::retranslateInternalButtons ( )
virtual

Retranslate internal buttons that are not accessible from the outside:

  • [Help]
  • [Steps]
  • [Tree]

Implemented from YWizard.

◆ selectTreeItem()

void YQWizard::selectTreeItem ( const std::string & id)
virtual

Select the tree item with the specified ID, if such an item exists.

Implemented from YWizard.

◆ sendEvent()

void YQWizard::sendEvent ( const std::string & id)
protected

Send a wizard event with the specified ID.

◆ sendMenuEvent

void YQWizard::sendMenuEvent ( QAction * action)
protectedslot

Internal notification that a menu item with numeric ID 'numID' has been activated.

◆ sendTreeEvent

void YQWizard::sendTreeEvent ( QTreeWidgetItem * item)
protectedslot

Internal notification that [Space] or [Return] has been pressed on a tree item. If the item has an ID, that ID will be returned to UI::UserInput().

◆ setButtonFocus()

void YQWizard::setButtonFocus ( YQWizardButton * button)
protected

Set the keyboard focus to a button.

◆ setButtonLabel() [1/2]

virtual void YQWizard::setButtonLabel ( YPushButton * button,
const std::string & newLabel )
virtual

Set the label of one of the wizard buttons (backButton(), abortButton(), nextButton() ) if that button is non-null.

Implemented from YWizard.

◆ setButtonLabel() [2/2]

void YQWizard::setButtonLabel ( YQWizardButton * button,
const QString & newLabel )
protected

Set a button's label.

◆ setCurrentStep()

void YQWizard::setCurrentStep ( const std::string & id)
virtual

Set the current step. This also triggers updateSteps() if necessary.

Implemented from YWizard.

◆ setDialogHeading()

void YQWizard::setDialogHeading ( const std::string & headingText)
virtual

Set the dialog heading.

Implemented from YWizard.

◆ setDialogIcon()

void YQWizard::setDialogIcon ( const std::string & iconName)
virtual

Set the dialog icon. An empty icon name clears the current icon.

Implemented from YWizard.

◆ setDialogTitle()

void YQWizard::setDialogTitle ( const std::string & titleText)
virtual

Set the dialog title shown in window manager's title bar. An empty std::string clears the current text.

Implemented from YWizard.

◆ setHelpText()

void YQWizard::setHelpText ( const std::string & helpText)
virtual

Set the help text.

Implemented from YWizard.

◆ setSize()

void YQWizard::setSize ( int newWidth,
int newHeight )
virtual

Set the new size of the widget.

Reimplemented from YWidget.

◆ showHelp

void YQWizard::showHelp ( )
slot

Show the current help text.

This is useful only if it is obscured by any wizard steps, but it can safely be called at any time.

◆ showHotkeys

void YQWizard::showHotkeys ( )
slot

Show an overview of the power-user hotkeys

Help text to be shown after pressing Shift-F1 listing the advanced keyboard shortcuts available in the Qt-UI

◆ showReleaseNotes

void YQWizard::showReleaseNotes ( )
protectedslot

Propagate button clicked event of release notes button to the application.

◆ showReleaseNotesButton()

void YQWizard::showReleaseNotesButton ( const std::string & label,
const std::string & id )
virtual

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.

◆ showSteps

void YQWizard::showSteps ( )
slot

Show the current wizard steps, if there are any. If there are none, nothing happens.

◆ showTree

void YQWizard::showTree ( )
slot

Show the current selection tree in the side panel, if there is any. If there is none, nothing happens.

◆ slotAbortClicked

void YQWizard::slotAbortClicked ( )
protectedslot

Internal notification that the "Abort" button has been clicked.

◆ slotBackClicked

void YQWizard::slotBackClicked ( )
protectedslot

Internal notification that the "Back" button has been clicked.

◆ slotNextClicked

void YQWizard::slotNextClicked ( )
protectedslot

Internal notification that the "Next" button has been clicked.

◆ stepsList()

QList< YQWizard::Step * > YQWizard::stepsList ( )
inline

Return list of pointers to steps. Not needed outside copySteps() function

◆ treeSelectionChanged

void YQWizard::treeSelectionChanged ( )
protectedslot

Internal notification that the tree selection has changed.

If the currently selected item has an ID, that ID will be returned to UI::UserInput().

◆ updateSteps()

void YQWizard::updateSteps ( )
virtual

Update the steps display: Reflect the internal steps and heading lists in the layout.

Implemented from YWizard.

◆ updateStepStates()

void YQWizard::updateStepStates ( )
protected

Update all step - use appropriate icons and colors

◆ workArea()

QWidget * YQWizard::workArea ( ) const
inline

Return this wizard's work area (the pane right of the side bar). This should not be needed outside of YQMainWinDock.


The documentation for this class was generated from the following files: