VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/wizards/UIWizardPage.cpp@ 82781

Last change on this file since 82781 was 79567, checked in by vboxsync, 5 years ago

FE/Qt: bugref:9484: UIWizardPage: Adjusting wizardImp() API to be const.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.8 KB
Line 
1/* $Id: UIWizardPage.cpp 79567 2019-07-06 12:43:14Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIWizardPage class implementation.
4 */
5
6/*
7 * Copyright (C) 2009-2019 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18/* Qt includes: */
19#include <QAbstractButton>
20
21/* GUI includes: */
22#include "UICommon.h"
23#include "UIWizard.h"
24#include "UIWizardPage.h"
25
26
27/*********************************************************************************************************************************
28* Class UIWizardPageBase implementation. *
29*********************************************************************************************************************************/
30
31UIWizard *UIWizardPageBase::wizardImp() const
32{
33 /* Should be reimplemented in sub-class to enable access to wizard! */
34 AssertMsgFailed(("UIWizardPageBase::wizardImp() should be reimplemented!"));
35 return 0;
36}
37
38UIWizardPage *UIWizardPageBase::thisImp()
39{
40 /* Should be reimplemented in sub-class to enable access to wizard page! */
41 AssertMsgFailed(("UIWizardPageBase::thisImp() should be reimplemented!"));
42 return 0;
43}
44
45QVariant UIWizardPageBase::fieldImp(const QString &) const
46{
47 /* Should be reimplemented in sub-class to enable access to wizard field! */
48 AssertMsgFailed(("UIWizardPageBase::fieldImp(const QString &) should be reimplemented!"));
49 return QVariant();
50}
51
52
53/*********************************************************************************************************************************
54* Class UIWizardPage implementation. *
55*********************************************************************************************************************************/
56
57UIWizardPage::UIWizardPage()
58 : m_fReady(false)
59{
60}
61
62void UIWizardPage::markReady()
63{
64 m_fReady = true;
65 QWizardPage::setTitle(m_strTitle);
66}
67
68void UIWizardPage::setTitle(const QString &strTitle)
69{
70 m_strTitle = strTitle;
71 if (m_fReady)
72 QWizardPage::setTitle(m_strTitle);
73}
74
75UIWizard *UIWizardPage::wizard() const
76{
77 return qobject_cast<UIWizard*>(QWizardPage::wizard());
78}
79
80void UIWizardPage::startProcessing()
81{
82 if (isFinalPage())
83 wizard()->button(QWizard::FinishButton)->setEnabled(false);
84}
85
86void UIWizardPage::endProcessing()
87{
88 if (isFinalPage())
89 wizard()->button(QWizard::FinishButton)->setEnabled(true);
90}
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use