Add job.setprogress to Python API.

main
Teo Mrnjavac 11 years ago
parent c6c2c67560
commit 2636a1273f

@ -45,7 +45,8 @@ BOOST_PYTHON_MODULE( libcalamares )
bp::class_< CalamaresPython::PythonJobInterface >( "job", bp::init< const Calamares::PythonJob* >() )
.def_readonly( "prettyName", &CalamaresPython::PythonJobInterface::prettyName )
.def_readonly( "workingPath", &CalamaresPython::PythonJobInterface::workingPath )
.def_readonly( "configuration", &CalamaresPython::PythonJobInterface::configuration );
.def_readonly( "configuration", &CalamaresPython::PythonJobInterface::configuration )
.def( "setprogress", &CalamaresPython::PythonJobInterface::setprogress );
bp::class_< Calamares::GlobalStorage >( "GlobalStorage", bp::init<>() )
.def( "contains", &Calamares::GlobalStorage::python_contains )
@ -148,6 +149,13 @@ PythonJob::exec()
}
void
PythonJob::emitProgress( double progressValue ) const
{
//emit progress( progressValue );
}
CalamaresPython::Helper*
PythonJob::helper()
{

@ -47,6 +47,8 @@ public:
private:
friend class CalamaresPython::Helper;
friend class CalamaresPython::PythonJobInterface;
void emitProgress( double progressValue ) const;
CalamaresPython::Helper* helper();
QString m_scriptFile;
QString m_workingPath;

@ -31,4 +31,12 @@ PythonJobInterface::PythonJobInterface( const Calamares::PythonJob* parent )
configuration = CalamaresPython::variantMapToPyDict( m_parent->m_configurationMap );
}
void
PythonJobInterface::setprogress( double progress )
{
if ( progress >= 0 && progress <= 1 )
m_parent->emitProgress( progress );
}
}

@ -39,6 +39,8 @@ public:
boost::python::dict configuration;
void setprogress( double progress );
private:
const Calamares::PythonJob* m_parent;
};

Loading…
Cancel
Save