From 4d9f887c587aa0490b1fbebd014766e9435c678e Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Wed, 3 Sep 2014 18:02:37 +0200 Subject: [PATCH] Make the prepare viewmodule use WaitingWidget --- src/modules/prepare/PrepareViewStep.cpp | 37 +++---------------------- 1 file changed, 4 insertions(+), 33 deletions(-) diff --git a/src/modules/prepare/PrepareViewStep.cpp b/src/modules/prepare/PrepareViewStep.cpp index 136b66570..0b0a3c675 100644 --- a/src/modules/prepare/PrepareViewStep.cpp +++ b/src/modules/prepare/PrepareViewStep.cpp @@ -21,7 +21,7 @@ #include "PreparePage.h" #include "partman_devices.h" -#include "widgets/QtWaitingSpinner.h" +#include "widgets/WaitingWidget.h" #include "utils/CalamaresUtilsGui.h" #include "utils/Logger.h" @@ -32,6 +32,7 @@ #include #include #include +#include PrepareViewStep::PrepareViewStep( QObject* parent ) : Calamares::ViewStep( parent ) @@ -44,38 +45,8 @@ PrepareViewStep::PrepareViewStep( QObject* parent ) m_widget->setLayout( mainLayout ); CalamaresUtils::unmarginLayout( mainLayout ); - QWidget* waitingWidget = new QWidget; - { - QBoxLayout* waitingLayout = new QVBoxLayout; - waitingWidget->setLayout( waitingLayout ); - waitingLayout->addStretch(); - QBoxLayout* pbLayout = new QHBoxLayout; - waitingLayout->addLayout( pbLayout ); - pbLayout->addStretch(); - - QtWaitingSpinner* spnr = new QtWaitingSpinner(); - pbLayout->addWidget( spnr ); - - pbLayout->addStretch(); - - QLabel* waitingLabel = new QLabel( "Gathering system information..." ); - - int spnrSize = waitingLabel->fontMetrics().height() * 4; - spnr->setFixedSize( spnrSize, spnrSize ); - spnr->setRadius( spnrSize / 2 ); - spnr->setLength( spnrSize / 2 ); - spnr->setWidth( spnrSize / 8 ); - spnr->start(); - - waitingLabel->setAlignment( Qt::AlignCenter); - waitingLayout->addSpacing( spnrSize / 2 ); - waitingLayout->addWidget( waitingLabel ); - waitingLayout->addStretch(); - - mainLayout->addWidget( waitingWidget ); - - CalamaresUtils::unmarginLayout( waitingLayout ); - } + QWidget* waitingWidget = new WaitingWidget( tr( "Gathering system information..." ) ); + mainLayout->addWidget( waitingWidget ); QTimer* timer = new QTimer; timer->setSingleShot( true );