[oemid] Initial version of UI
This commit is contained in:
parent
96828c1df0
commit
ae85381aae
@ -3,6 +3,8 @@ calamares_add_plugin( oemid
|
|||||||
EXPORT_MACRO PLUGINDLLEXPORT_PRO
|
EXPORT_MACRO PLUGINDLLEXPORT_PRO
|
||||||
SOURCES
|
SOURCES
|
||||||
OEMViewStep.cpp
|
OEMViewStep.cpp
|
||||||
|
UI
|
||||||
|
OEMPage.ui
|
||||||
LINK_PRIVATE_LIBRARIES
|
LINK_PRIVATE_LIBRARIES
|
||||||
calamaresui
|
calamaresui
|
||||||
Qt5::Widgets
|
Qt5::Widgets
|
||||||
|
45
src/modules/oemid/OEMPage.ui
Normal file
45
src/modules/oemid/OEMPage.ui
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>OEMPage</class>
|
||||||
|
<widget class="QWidget" name="OEMPage">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>400</width>
|
||||||
|
<height>300</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="gridLayoutWidget">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>-1</x>
|
||||||
|
<y>9</y>
|
||||||
|
<width>391</width>
|
||||||
|
<height>281</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QLineEdit" name="batchIdentifier">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><html><head/><body><p>Enter a batch-identifier here. This will be stored in the target system.</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="batchIdentifier_label">
|
||||||
|
<property name="text">
|
||||||
|
<string>Batch:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
@ -18,10 +18,27 @@
|
|||||||
|
|
||||||
#include "OEMViewStep.h"
|
#include "OEMViewStep.h"
|
||||||
|
|
||||||
|
#include "ui_OEMPage.h"
|
||||||
|
|
||||||
#include "utils/Variant.h"
|
#include "utils/Variant.h"
|
||||||
|
|
||||||
#include <QDate>
|
#include <QDate>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
|
#include <QWidget>
|
||||||
|
|
||||||
|
class OEMPage : public QWidget
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
OEMPage()
|
||||||
|
: QWidget( nullptr )
|
||||||
|
, m_ui( new Ui_OEMPage() )
|
||||||
|
{
|
||||||
|
m_ui->setupUi( this );
|
||||||
|
}
|
||||||
|
|
||||||
|
Ui_OEMPage* m_ui;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
OEMViewStep::OEMViewStep(QObject* parent)
|
OEMViewStep::OEMViewStep(QObject* parent)
|
||||||
: Calamares::ViewStep( parent )
|
: Calamares::ViewStep( parent )
|
||||||
@ -32,6 +49,8 @@ OEMViewStep::OEMViewStep(QObject* parent)
|
|||||||
|
|
||||||
OEMViewStep::~OEMViewStep()
|
OEMViewStep::~OEMViewStep()
|
||||||
{
|
{
|
||||||
|
if ( m_widget && m_widget->parent() == nullptr )
|
||||||
|
m_widget->deleteLater();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OEMViewStep::isBackEnabled() const
|
bool OEMViewStep::isBackEnabled() const
|
||||||
@ -68,17 +87,16 @@ static QString substitute( QString s )
|
|||||||
|
|
||||||
void OEMViewStep::onActivate()
|
void OEMViewStep::onActivate()
|
||||||
{
|
{
|
||||||
if ( !m_visited && m_user_batchIdentifier.isEmpty() )
|
if ( !m_widget )
|
||||||
{
|
(void) widget();
|
||||||
m_user_batchIdentifier = substitute( m_conf_batchIdentifier );
|
if ( !m_visited && m_widget )
|
||||||
// m_widget->setIdentifier( m_user_batchIdentifier );
|
m_widget->m_ui->batchIdentifier->setText( m_user_batchIdentifier );
|
||||||
}
|
|
||||||
m_visited = true;
|
m_visited = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void OEMViewStep::onLeave()
|
void OEMViewStep::onLeave()
|
||||||
{
|
{
|
||||||
// m_user_batchIdentifier = m_widget->identifier();
|
m_user_batchIdentifier = m_widget->m_ui->batchIdentifier->text();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString OEMViewStep::prettyName() const
|
QString OEMViewStep::prettyName() const
|
||||||
@ -88,7 +106,9 @@ QString OEMViewStep::prettyName() const
|
|||||||
|
|
||||||
QWidget * OEMViewStep::widget()
|
QWidget * OEMViewStep::widget()
|
||||||
{
|
{
|
||||||
return nullptr; // m_widget;
|
if (!m_widget)
|
||||||
|
m_widget = new OEMPage;
|
||||||
|
return m_widget;
|
||||||
}
|
}
|
||||||
|
|
||||||
Calamares::JobList OEMViewStep::jobs() const
|
Calamares::JobList OEMViewStep::jobs() const
|
||||||
@ -99,6 +119,7 @@ Calamares::JobList OEMViewStep::jobs() const
|
|||||||
void OEMViewStep::setConfigurationMap(const QVariantMap& configurationMap)
|
void OEMViewStep::setConfigurationMap(const QVariantMap& configurationMap)
|
||||||
{
|
{
|
||||||
m_conf_batchIdentifier = CalamaresUtils::getString( configurationMap, "batch-identifier" );
|
m_conf_batchIdentifier = CalamaresUtils::getString( configurationMap, "batch-identifier" );
|
||||||
|
m_user_batchIdentifier = substitute( m_conf_batchIdentifier );
|
||||||
}
|
}
|
||||||
|
|
||||||
CALAMARES_PLUGIN_FACTORY_DEFINITION( OEMViewStepFactory, registerPlugin<OEMViewStep>(); )
|
CALAMARES_PLUGIN_FACTORY_DEFINITION( OEMViewStepFactory, registerPlugin<OEMViewStep>(); )
|
||||||
|
Loading…
Reference in New Issue
Block a user