mirror of
https://github.com/parchlinux/calamares.git
synced 2025-07-01 19:35:36 -04:00
[libcalamaresui] Add properties to ViewManager to expose Settings
This commit is contained in:
parent
849da3f322
commit
6a1e46d7f6
2 changed files with 33 additions and 0 deletions
|
@ -608,4 +608,25 @@ ViewManager::rowCount( const QModelIndex& parent ) const
|
||||||
return m_steps.length();
|
return m_steps.length();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
ViewManager::isChrootMode() const
|
||||||
|
{
|
||||||
|
const auto* s = Settings::instance();
|
||||||
|
return s ? s->doChroot() : true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
ViewManager::isDebugMode() const
|
||||||
|
{
|
||||||
|
const auto* s = Settings::instance();
|
||||||
|
return s ? s->debugMode() : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
ViewManager::isSetupMode() const
|
||||||
|
{
|
||||||
|
const auto* s = Settings::instance();
|
||||||
|
return s ? s->isSetupMode() : false;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Calamares
|
} // namespace Calamares
|
||||||
|
|
|
@ -50,6 +50,11 @@ class UIDLLEXPORT ViewManager : public QAbstractListModel
|
||||||
///@brief Sides on which the ViewManager has side-panels
|
///@brief Sides on which the ViewManager has side-panels
|
||||||
Q_PROPERTY( Qt::Orientations panelSides READ panelSides WRITE setPanelSides MEMBER m_panelSides )
|
Q_PROPERTY( Qt::Orientations panelSides READ panelSides WRITE setPanelSides MEMBER m_panelSides )
|
||||||
|
|
||||||
|
// Global properties, where ViewManager proxies to Settings
|
||||||
|
Q_PROPERTY( bool isDebugMode READ isDebugMode CONSTANT FINAL )
|
||||||
|
Q_PROPERTY( bool isChrootMode READ isChrootMode CONSTANT FINAL )
|
||||||
|
Q_PROPERTY( bool isSetupMode READ isSetupMode CONSTANT FINAL )
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* @brief instance access to the ViewManager singleton.
|
* @brief instance access to the ViewManager singleton.
|
||||||
|
@ -197,6 +202,13 @@ public Q_SLOTS:
|
||||||
/// @brief Connected to ViewStep::nextStatusChanged for all steps
|
/// @brief Connected to ViewStep::nextStatusChanged for all steps
|
||||||
void updateNextStatus( bool enabled );
|
void updateNextStatus( bool enabled );
|
||||||
|
|
||||||
|
/// @brief Proxy to Settings::debugMode() default @c false
|
||||||
|
bool isDebugMode() const;
|
||||||
|
/// @brief Proxy to Settings::doChroot() default @c true
|
||||||
|
bool isChrootMode() const;
|
||||||
|
/// @brief Proxy to Settings::isSetupMode() default @c false
|
||||||
|
bool isSetupMode() const;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void currentStepChanged();
|
void currentStepChanged();
|
||||||
void ensureSize( QSize size ) const; // See ViewStep::ensureSize()
|
void ensureSize( QSize size ) const; // See ViewStep::ensureSize()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue