Add Modules page to DebugWindow.
This commit is contained in:
parent
dda7ea211d
commit
5951208c1b
@ -22,8 +22,12 @@
|
|||||||
#include "JobQueue.h"
|
#include "JobQueue.h"
|
||||||
#include "Job.h"
|
#include "Job.h"
|
||||||
#include "GlobalStorage.h"
|
#include "GlobalStorage.h"
|
||||||
|
#include "modulesystem/ModuleManager.h"
|
||||||
|
#include "modulesystem/Module.h"
|
||||||
|
|
||||||
#include <QJsonDocument>
|
#include <QJsonDocument>
|
||||||
|
#include <QSplitter>
|
||||||
|
#include <QStringListModel>
|
||||||
#include <QTreeView>
|
#include <QTreeView>
|
||||||
|
|
||||||
namespace Calamares {
|
namespace Calamares {
|
||||||
@ -34,6 +38,7 @@ DebugWindow::DebugWindow()
|
|||||||
|
|
||||||
setupUi( this );
|
setupUi( this );
|
||||||
|
|
||||||
|
// GlobalStorage page
|
||||||
QJsonModel* jsonModel = new QJsonModel( this );
|
QJsonModel* jsonModel = new QJsonModel( this );
|
||||||
|
|
||||||
globalStorageView->setModel( jsonModel );
|
globalStorageView->setModel( jsonModel );
|
||||||
@ -47,6 +52,7 @@ DebugWindow::DebugWindow()
|
|||||||
jsonModel->loadJson( QJsonDocument::fromVariant( gs->m ).toJson() );
|
jsonModel->loadJson( QJsonDocument::fromVariant( gs->m ).toJson() );
|
||||||
globalStorageView->expandAll();
|
globalStorageView->expandAll();
|
||||||
|
|
||||||
|
// JobQueue page
|
||||||
jobQueueText->setReadOnly( true );
|
jobQueueText->setReadOnly( true );
|
||||||
connect( JobQueue::instance(), &JobQueue::queueChanged,
|
connect( JobQueue::instance(), &JobQueue::queueChanged,
|
||||||
[ this ]( const QList< Calamares::job_ptr >& jobs )
|
[ this ]( const QList< Calamares::job_ptr >& jobs )
|
||||||
@ -60,6 +66,31 @@ DebugWindow::DebugWindow()
|
|||||||
jobQueueText->setText( text.join( '\n' ) );
|
jobQueueText->setText( text.join( '\n' ) );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
// Modules page
|
||||||
|
QSplitter* splitter = new QSplitter( modulesTab );
|
||||||
|
modulesTab->layout()->addWidget( splitter );
|
||||||
|
splitter->addWidget( modulesListView );
|
||||||
|
splitter->addWidget( moduleConfigView );
|
||||||
|
|
||||||
|
QStringListModel* modulesModel = new QStringListModel( ModuleManager::instance()->availableModules() );
|
||||||
|
modulesListView->setModel( modulesModel );
|
||||||
|
modulesListView->setSelectionMode( QAbstractItemView::SingleSelection );
|
||||||
|
|
||||||
|
QJsonModel* moduleConfigModel = new QJsonModel( this );
|
||||||
|
moduleConfigView->setModel( moduleConfigModel );
|
||||||
|
|
||||||
|
connect( modulesListView->selectionModel(), &QItemSelectionModel::selectionChanged,
|
||||||
|
[ this, moduleConfigModel ]
|
||||||
|
{
|
||||||
|
QString moduleName = modulesListView->currentIndex().data().toString();
|
||||||
|
Module* module = ModuleManager::instance()->module( moduleName );
|
||||||
|
if ( module )
|
||||||
|
{
|
||||||
|
moduleConfigModel->loadJson( QJsonDocument::fromVariant( module->configurationMap() ).toJson() );
|
||||||
|
moduleConfigView->expandAll();
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
|
||||||
CALAMARES_RETRANSLATE( retranslateUi( this ); )
|
CALAMARES_RETRANSLATE( retranslateUi( this ); )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tab">
|
<widget class="QWidget" name="globalStorageTab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
<string>GlobalStorage</string>
|
<string>GlobalStorage</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
@ -29,7 +29,7 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="tab_2">
|
<widget class="QWidget" name="jobQueueTab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
<string>JobQueue</string>
|
<string>JobQueue</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
@ -39,6 +39,19 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QWidget" name="modulesTab">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>Modules</string>
|
||||||
|
</attribute>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QListView" name="modulesListView"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QTreeView" name="moduleConfigView"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
Loading…
Reference in New Issue
Block a user