libyui-qt  2.47.1.1
YQWizard Class Reference
Inheritance diagram for YQWizard:
Collaboration diagram for YQWizard:

Classes

class  Step
 Helper class to represent a wizard step internally. More...
 
class  StepHeading
 Helper class to represent a wizard step heading internally. More...
 
class  TreeItem
 Helper class for wizard tree item. More...
 

Public Types

enum  Direction { Forward, Backward }
 

Public Slots

void resizeClientArea ()
 Adapt the size of the client area (the ReplacePoint(id(contents)) to fit in its current space.
 
void showHelp ()
 Show the current help text. More...
 
void showHotkeys ()
 Show an overview of the power-user hotkeys. More...
 
void showSteps ()
 Show the current wizard steps, if there are any. More...
 
void showTree ()
 Show the current selection tree in the side panel, if there is any. More...
 

Signals

void backClicked ()
 Emitted when the "Back" or "Cancel" button is clicked.
 
void abortClicked ()
 Emitted when the "Abort" button is clicked.
 
void nextClicked ()
 Emitted when the "Next" or "OK" button is clicked. More...
 

Public Member Functions

 YQWizard (YWidget *parent, const std::string &backButtonLabel, const std::string &abortButtonLabel, const std::string &nextButtonLabel, YWizardMode wizardMode=YWizardMode_Standard)
 Constructor.
 
virtual ~YQWizard ()
 Destructor.
 
virtual std::string debugLabel () const
 Returns a descriptive label of this dialog instance for debugging. More...
 
Direction direction () const
 Returns the current direction of wizard operations - going forward or going backward. More...
 
virtual YQWizardButtonbackButton () const
 Return internal widgets. More...
 
virtual YQWizardButtonabortButton () const
 
virtual YQWizardButtonnextButton () const
 
virtual YReplacePoint * contentsReplacePoint () const
 
virtual void setButtonLabel (YPushButton *button, const std::string &newLabel)
 Set the label of one of the wizard buttons (backButton(), abortButton(), nextButton() ) if that button is non-null. More...
 
virtual void setHelpText (const std::string &helpText)
 Set the help text. More...
 
virtual void setDialogIcon (const std::string &iconName)
 Set the dialog icon. More...
 
virtual void setDialogTitle (const std::string &titleText)
 Set the dialog title shown in window manager's title bar. More...
 
virtual void setDialogHeading (const std::string &headingText)
 Set the dialog heading. More...
 
virtual void addStep (const std::string &text, const std::string &id)
 Add a step for the steps panel on the side bar. More...
 
virtual void addStepHeading (const std::string &text)
 Add a step heading for the steps panel on the side bar. More...
 
QList< YQWizard::Step * > stepsList ()
 Return list of pointers to steps. More...
 
void copySteps (YQWizard *wizard)
 Create a copy of given wizard's steps set (names & IDs) Populates _stepsList structure of current wizard. More...
 
virtual void deleteSteps ()
 Delete all steps and step headings from the internal lists. More...
 
virtual void setCurrentStep (const std::string &id)
 Set the current step. More...
 
QString currentStep ()
 Return QString ID of currently active step. More...
 
virtual void updateSteps ()
 Update the steps display: Reflect the internal steps and heading lists in the layout. More...
 
virtual void addTreeItem (const std::string &parentID, const std::string &text, const std::string &id)
 Add a tree item. More...
 
virtual void selectTreeItem (const std::string &id)
 Select the tree item with the specified ID, if such an item exists. More...
 
virtual std::string currentTreeSelection ()
 Returns the current tree selection or an empty std::string if nothing is selected or there is no tree. More...
 
virtual void deleteTreeItems ()
 Delete all tree items. More...
 
virtual void addMenu (const std::string &text, const std::string &id)
 Add a menu to the menu bar. More...
 
virtual void addSubMenu (const std::string &parentMenuID, const std::string &text, const std::string &id)
 Add a submenu to the menu with ID 'parentMenuID'. More...
 
virtual void addMenuEntry (const std::string &parentMenuID, const std::string &text, const std::string &id)
 Add a menu entry to the menu with ID 'parentMenuID'. More...
 
virtual void addMenuSeparator (const std::string &parentMenuID)
 Add a menu separator to a menu. More...
 
virtual void deleteMenus ()
 Delete all menus and hide the menu bar. More...
 
virtual void showReleaseNotesButton (const std::string &label, const std::string &id)
 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. More...
 
virtual void hideReleaseNotesButton ()
 Hide an existing "Release Notes" button. More...
 
virtual void retranslateInternalButtons ()
 Retranslate internal buttons that are not accessible from the outside: More...
 
virtual bool eventFilter (QObject *obj, QEvent *ev)
 Event filter. More...
 
QWidget * workArea () const
 Return this wizard's work area (the pane right of the side bar). More...
 
virtual int preferredWidth ()
 Preferred width of the widget. More...
 
virtual int preferredHeight ()
 Preferred height of the widget. More...
 
virtual void setSize (int newWidth, int newHeight)
 Set the new size of the widget. More...
 
bool isSecondary () const
 Returns true if the wizard should follow the first wizard with steps.
 

Protected Slots

void slotBackClicked ()
 Internal notification that the "Back" button has been clicked.
 
void slotAbortClicked ()
 Internal notification that the "Abort" button has been clicked.
 
void slotNextClicked ()
 Internal notification that the "Next" button has been clicked.
 
void showReleaseNotes ()
 Propagate button clicked event of release notes button to the application.
 
void sendTreeEvent (QTreeWidgetItem *item)
 Internal notification that [Space] or [Return] has been pressed on a tree item. More...
 
void treeSelectionChanged ()
 Internal notification that the tree selection has changed. More...
 
void sendMenuEvent (QAction *action)
 Internal notification that a menu item with numeric ID 'numID' has been activated.
 

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)
 
bool titleIsOnTheLeft ()
 
void destroyButtons ()
 Destroy the button box's buttons.
 
void updateStepStates ()
 Update all step - use appropriate icons and colors.
 
void sendEvent (const std::string &id)
 Send a wizard event with the specified ID.
 
void connectNotify (const char *signal)
 Notification that a signal is being connected. More...
 
void disconnectNotify (const char *signal)
 Notification that a signal is being disconnected. More...
 
void setButtonLabel (YQWizardButton *button, const QString &newLabel)
 Set a button's label.
 
void enableButton (YQWizardButton *button, bool enabled)
 Enable or disable a button.
 
void setButtonFocus (YQWizardButton *button)
 Set the keyboard focus to a button.
 
YQWizard::StepfindStep (const QString &id)
 Find a step with the specified ID. More...
 
YQWizard::TreeItemfindTreeItem (const std::string &id)
 Find a tree item with the specified ID. More...
 

Protected Attributes

std::string _backButtonLabel
 
std::string _abortButtonLabel
 
std::string _nextButtonLabel
 
bool _stepsEnabled
 
bool _stepsRegistered
 
bool _treeEnabled
 
bool _protectNextButton
 
bool _stepsDirty
 
bool _sendButtonEvents
 
Direction _direction
 
QString _currentStepID
 
QString _qHelpText
 
QString _qHotkeysText
 
QY2HelpDialog_helpDlg
 
QY2HelpDialog_hotkeysDlg
 
QY2RelNotesDialog_relNotesDlg
 
QStackedWidget * _sideBar
 
QWidget * _stepsPanel
 
YQWizardButton_releaseNotesButton
 
YQWizardButton_helpButton
 
QAction * _helpAction
 
QAction * _hotkeysAction
 
QPushButton * _stepsButton
 
QPushButton * _treeButton
 
QFrame * _treePanel
 
QY2ListView_tree
 
QFrame * _workArea
 
QWidget * _clientArea
 
QMenuBar * _menuBar
 
QLabel * _dialogIcon
 
QLabel * _dialogLogo
 
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 = ""
 

Detailed Description

Definition at line 64 of file YQWizard.h.

Member Function Documentation

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.

Definition at line 1193 of file YQWizard.cc.

Here is the call graph for this function:

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.

Definition at line 1237 of file YQWizard.cc.

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

Add a menu separator to a menu.

Implemented from YWizard.

Definition at line 1260 of file YQWizard.cc.

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.

Definition at line 292 of file YQWizard.cc.

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.

Definition at line 328 of file YQWizard.cc.

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.

Definition at line 1213 of file YQWizard.cc.

Here is the call graph for this function:

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.

Definition at line 583 of file YQWizard.cc.

Here is the call graph for this function:

virtual YQWizardButton* YQWizard::backButton ( ) const
inlinevirtual

Return internal widgets.

Implemented from YWizard.

Definition at line 112 of file YQWizard.h.

Here is the call graph for this function:

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

Notification that a signal is being connected.

Reimplemented from QObject.

Definition at line 973 of file YQWizard.cc.

void YQWizard::copySteps ( YQWizard wizard)

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

Definition at line 495 of file YQWizard.cc.

Here is the call graph for this function:

QString YQWizard::currentStep ( )
inline

Return QString ID of currently active step.

Definition at line 212 of file YQWizard.h.

Here is the call graph for this function:

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.

Definition at line 673 of file YQWizard.cc.

Here is the call graph for this function:

string YQWizard::debugLabel ( ) const
virtual

Returns a descriptive label of this dialog instance for debugging.

Reimplemented from YWidget.

Definition at line 1040 of file YQWizard.cc.

void YQWizard::deleteMenus ( )
virtual

Delete all menus and hide the menu bar.

Implemented from YWizard.

Definition at line 1275 of file YQWizard.cc.

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.

Definition at line 527 of file YQWizard.cc.

void YQWizard::deleteTreeItems ( )
virtual

Delete all tree items.

Implemented from YWizard.

Definition at line 618 of file YQWizard.cc.

Here is the call graph for this function:

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.

Definition at line 101 of file YQWizard.h.

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

Notification that a signal is being disconnected.

Reimplemented from QObject.

Definition at line 983 of file YQWizard.cc.

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

Event filter.

Reimplemented from QWidget.

Definition at line 1330 of file YQWizard.cc.

Here is the call graph for this function:

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

Find a step with the specified ID.

Returns 0 if there is no such step.

Definition at line 542 of file YQWizard.cc.

Here is the call graph for this function:

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.

Definition at line 628 of file YQWizard.cc.

void YQWizard::hideReleaseNotesButton ( )
virtual

Hide an existing "Release Notes" button.

Implemented from YWizard.

Definition at line 1386 of file YQWizard.cc.

Here is the call graph for this function:

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.

int YQWizard::preferredHeight ( )
virtual

Preferred height of the widget.

Reimplemented from YWidget.

Definition at line 1312 of file YQWizard.cc.

int YQWizard::preferredWidth ( )
virtual

Preferred width of the widget.

Reimplemented from YWidget.

Definition at line 1306 of file YQWizard.cc.

void YQWizard::retranslateInternalButtons ( )
virtual

Retranslate internal buttons that are not accessible from the outside:

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

Implemented from YWizard.

Definition at line 1397 of file YQWizard.cc.

Here is the call graph for this function:

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

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

Implemented from YWizard.

Definition at line 637 of file YQWizard.cc.

Here is the call graph for this function:

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().

Definition at line 654 of file YQWizard.cc.

Here is the call graph for this function:

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.

Definition at line 1348 of file YQWizard.cc.

Here is the call graph for this function:

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

Set the current step.

This also triggers updateSteps() if necessary.

Implemented from YWizard.

Definition at line 487 of file YQWizard.cc.

Here is the call graph for this function:

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

Set the dialog heading.

Implemented from YWizard.

Definition at line 1029 of file YQWizard.cc.

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

Set the dialog icon.

An empty icon name clears the current icon.

Implemented from YWizard.

Definition at line 993 of file YQWizard.cc.

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.

Definition at line 1018 of file YQWizard.cc.

Here is the call graph for this function:

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

Set the help text.

Implemented from YWizard.

Definition at line 1055 of file YQWizard.cc.

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

Set the new size of the widget.

Reimplemented from YWidget.

Definition at line 1318 of file YQWizard.cc.

Here is the call graph for this function:

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.

Definition at line 1093 of file YQWizard.cc.

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

Definition at line 1109 of file YQWizard.cc.

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.

Definition at line 1365 of file YQWizard.cc.

Here is the call graph for this function:

void YQWizard::showSteps ( )
slot

Show the current wizard steps, if there are any.

If there are none, nothing happens.

Definition at line 1175 of file YQWizard.cc.

void YQWizard::showTree ( )
slot

Show the current selection tree in the side panel, if there is any.

If there is none, nothing happens.

Definition at line 1184 of file YQWizard.cc.

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

Return list of pointers to steps.

Not needed outside copySteps() function

Definition at line 184 of file YQWizard.h.

Here is the call graph for this function:

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().

Definition at line 666 of file YQWizard.cc.

Here is the call graph for this function:

void YQWizard::updateSteps ( )
virtual

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

Implemented from YWizard.

Definition at line 335 of file YQWizard.cc.

Here is the call graph for this function:

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.

Definition at line 356 of file YQWizard.h.

Here is the call graph for this function:


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