[libcalamares] Call Python function if available for status
This commit is contained in:
parent
252089e372
commit
b4aaf85ccf
@ -168,7 +168,6 @@ namespace Calamares
|
|||||||
struct PythonJob::Private
|
struct PythonJob::Private
|
||||||
{
|
{
|
||||||
bp::object m_prettyStatusMessage;
|
bp::object m_prettyStatusMessage;
|
||||||
bp::object m_prettyName;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
PythonJob::PythonJob( const ModuleSystem::InstanceKey& instance,
|
PythonJob::PythonJob( const ModuleSystem::InstanceKey& instance,
|
||||||
@ -205,6 +204,21 @@ PythonJob::prettyName() const
|
|||||||
QString
|
QString
|
||||||
PythonJob::prettyStatusMessage() const
|
PythonJob::prettyStatusMessage() const
|
||||||
{
|
{
|
||||||
|
if ( m_d && !m_d->m_prettyStatusMessage.is_none() )
|
||||||
|
{
|
||||||
|
cDebug() << "Getting dynamic message";
|
||||||
|
QString r;
|
||||||
|
bp::extract< std::string > result( m_d->m_prettyStatusMessage() );
|
||||||
|
r = result.check() ? QString::fromStdString( result() ).trimmed() : QString();
|
||||||
|
if ( !r.isEmpty() )
|
||||||
|
{
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cDebug() << "Getting static message";
|
||||||
|
}
|
||||||
if ( m_description.isEmpty() )
|
if ( m_description.isEmpty() )
|
||||||
{
|
{
|
||||||
return tr( "Running %1 operation." ).arg( QDir( m_workingPath ).dirName() );
|
return tr( "Running %1 operation." ).arg( QDir( m_workingPath ).dirName() );
|
||||||
|
Loading…
Reference in New Issue
Block a user