[calamares] Fix singleton-ness of the progress view
- Create the ViewManager earlier, - Create a ProgressTreeModel here for the view, - Do not weirdly set the model much later.
This commit is contained in:
parent
290a708e56
commit
b209668d33
@ -339,8 +339,8 @@ CalamaresApplication::initViewSteps()
|
|||||||
m_mainwindow->show();
|
m_mainwindow->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
ProgressTreeModel* m = new ProgressTreeModel( nullptr );
|
// ProgressTreeModel* m = new ProgressTreeModel( nullptr );
|
||||||
ProgressTreeView::instance()->setModel( m );
|
// ProgressTreeView::instance()->setModel( m );
|
||||||
cDebug() << "STARTUP: Window now visible and ProgressTreeView populated";
|
cDebug() << "STARTUP: Window now visible and ProgressTreeView populated";
|
||||||
|
|
||||||
const auto steps = Calamares::ViewManager::instance()->viewSteps();
|
const auto steps = Calamares::ViewManager::instance()->viewSteps();
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
#include "DebugWindow.h"
|
#include "DebugWindow.h"
|
||||||
#include "Settings.h"
|
#include "Settings.h"
|
||||||
#include "ViewManager.h"
|
#include "ViewManager.h"
|
||||||
|
#include "progresstree/ProgressTreeModel.h"
|
||||||
#include "progresstree/ProgressTreeView.h"
|
#include "progresstree/ProgressTreeView.h"
|
||||||
#include "utils/CalamaresUtilsGui.h"
|
#include "utils/CalamaresUtilsGui.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
@ -93,8 +94,9 @@ CalamaresWindow::getWidgetSidebar( int desiredWidth )
|
|||||||
logoLayout->addStretch();
|
logoLayout->addStretch();
|
||||||
|
|
||||||
ProgressTreeView* tv = new ProgressTreeView( sideBox );
|
ProgressTreeView* tv = new ProgressTreeView( sideBox );
|
||||||
sideLayout->addWidget( tv );
|
tv->setModel( new ProgressTreeModel );
|
||||||
tv->setFocusPolicy( Qt::NoFocus );
|
tv->setFocusPolicy( Qt::NoFocus );
|
||||||
|
sideLayout->addWidget( tv );
|
||||||
|
|
||||||
if ( Calamares::Settings::instance()->debugMode() || ( Logger::logLevel() >= Logger::LOGVERBOSE ) )
|
if ( Calamares::Settings::instance()->debugMode() || ( Logger::logLevel() >= Logger::LOGVERBOSE ) )
|
||||||
{
|
{
|
||||||
@ -169,6 +171,8 @@ CalamaresWindow::CalamaresWindow( QWidget* parent )
|
|||||||
cDebug() << Logger::SubEntry << "Proposed window size:" << w << h;
|
cDebug() << Logger::SubEntry << "Proposed window size:" << w << h;
|
||||||
resize( w, h );
|
resize( w, h );
|
||||||
|
|
||||||
|
m_viewManager = Calamares::ViewManager::instance( this );
|
||||||
|
|
||||||
QBoxLayout* mainLayout = new QHBoxLayout;
|
QBoxLayout* mainLayout = new QHBoxLayout;
|
||||||
setLayout( mainLayout );
|
setLayout( mainLayout );
|
||||||
|
|
||||||
@ -183,9 +187,6 @@ CalamaresWindow::CalamaresWindow( QWidget* parent )
|
|||||||
mainLayout->addWidget( sideBox );
|
mainLayout->addWidget( sideBox );
|
||||||
}
|
}
|
||||||
|
|
||||||
CalamaresUtils::unmarginLayout( mainLayout );
|
|
||||||
|
|
||||||
m_viewManager = Calamares::ViewManager::instance( this );
|
|
||||||
if ( branding->windowExpands() )
|
if ( branding->windowExpands() )
|
||||||
{
|
{
|
||||||
connect( m_viewManager, &Calamares::ViewManager::enlarge, this, &CalamaresWindow::enlarge );
|
connect( m_viewManager, &Calamares::ViewManager::enlarge, this, &CalamaresWindow::enlarge );
|
||||||
@ -200,6 +201,7 @@ CalamaresWindow::CalamaresWindow( QWidget* parent )
|
|||||||
// event, which is also the ViewManager's responsibility.
|
// event, which is also the ViewManager's responsibility.
|
||||||
|
|
||||||
mainLayout->addWidget( m_viewManager->centralWidget() );
|
mainLayout->addWidget( m_viewManager->centralWidget() );
|
||||||
|
CalamaresUtils::unmarginLayout( mainLayout );
|
||||||
setStyleSheet( Calamares::Branding::instance()->stylesheet() );
|
setStyleSheet( Calamares::Branding::instance()->stylesheet() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user