diff --git a/src/calamares/CalamaresWindow.cpp b/src/calamares/CalamaresWindow.cpp index c9f4df3..873f026 100644 --- a/src/calamares/CalamaresWindow.cpp +++ b/src/calamares/CalamaresWindow.cpp @@ -22,9 +22,7 @@ #include "progresstree/ProgressTreeView.h" #include "utils/CalamaresUtilsGui.h" #include "utils/Logger.h" -#include "utils/DebugWindow.h" #include "utils/Retranslator.h" -#include "Settings.h" #include "Branding.h" #include @@ -35,7 +33,6 @@ CalamaresWindow::CalamaresWindow( QWidget* parent ) : QWidget( parent ) - , m_debugWindow( nullptr ) { // Hide close button setWindowFlags( Qt::Window | Qt::WindowTitleHint | Qt::CustomizeWindowHint ); @@ -90,40 +87,6 @@ CalamaresWindow::CalamaresWindow( QWidget* parent ) ProgressTreeView* tv = new ProgressTreeView( sideBox ); sideLayout->addWidget( tv ); tv->setFocusPolicy( Qt::NoFocus ); - - if ( Calamares::Settings::instance()->debugMode() ) - { - QPushButton* debugWindowBtn = new QPushButton; - CALAMARES_RETRANSLATE( - debugWindowBtn->setText( tr( "Show debug information" ) ); - ) - sideLayout->addWidget( debugWindowBtn ); - debugWindowBtn->setFlat( true ); - debugWindowBtn->setCheckable( true ); - connect( debugWindowBtn, &QPushButton::clicked, - [ this, debugWindowBtn ]( bool checked ) - { - if ( checked ) - { - m_debugWindow = new Calamares::DebugWindow(); - m_debugWindow->show(); - connect( m_debugWindow, &Calamares::DebugWindow::closed, - [ this, debugWindowBtn ] - { - m_debugWindow->deleteLater(); - debugWindowBtn->setChecked( false ); - } ); - } - else - { - if ( m_debugWindow ) - { - m_debugWindow->deleteLater(); - } - } - } ); - } - CalamaresUtils::unmarginLayout( sideLayout ); CalamaresUtils::unmarginLayout( mainLayout ); diff --git a/src/calamares/CalamaresWindow.h b/src/calamares/CalamaresWindow.h index 6ea9602..763c11f 100644 --- a/src/calamares/CalamaresWindow.h +++ b/src/calamares/CalamaresWindow.h @@ -19,14 +19,8 @@ #ifndef CALAMARESWINDOW_H #define CALAMARESWINDOW_H -#include #include -namespace Calamares -{ -class DebugWindow; -} - class CalamaresWindow : public QWidget { Q_OBJECT @@ -34,8 +28,6 @@ public: CalamaresWindow( QWidget* parent = nullptr ); virtual ~CalamaresWindow() {} -private: - QPointer< Calamares::DebugWindow > m_debugWindow; }; #endif //CALAMARESWINDOW_H diff --git a/src/libcalamaresui/CMakeLists.txt b/src/libcalamaresui/CMakeLists.txt index df36f3b..49ccb7f 100644 --- a/src/libcalamaresui/CMakeLists.txt +++ b/src/libcalamaresui/CMakeLists.txt @@ -7,7 +7,6 @@ list( APPEND ${CALAMARESUI_LIBRARY_TARGET}_SOURCES modulesystem/ViewModule.cpp utils/CalamaresUtilsGui.cpp - utils/DebugWindow.cpp utils/ImageRegistry.cpp utils/YamlUtils.cpp @@ -28,7 +27,6 @@ list( APPEND ${CALAMARESUI_LIBRARY_TARGET}_SOURCES ) list( APPEND ${CALAMARESUI_LIBRARY_TARGET}_UI - utils/DebugWindow.ui ) if( WITH_PYTHON ) diff --git a/src/libcalamaresui/utils/DebugWindow.cpp b/src/libcalamaresui/utils/DebugWindow.cpp deleted file mode 100644 index d94a539..0000000 --- a/src/libcalamaresui/utils/DebugWindow.cpp +++ /dev/null @@ -1,107 +0,0 @@ -/* === This file is part of Calamares - === - * - * Copyright 2015, Teo Mrnjavac - * - * Calamares is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Calamares is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Calamares. If not, see . - */ - -#include "DebugWindow.h" -#include "utils/Retranslator.h" -#include "utils/qjsonmodel.h" -#include "JobQueue.h" -#include "Job.h" -#include "GlobalStorage.h" -#include "modulesystem/ModuleManager.h" -#include "modulesystem/Module.h" - -#include -#include -#include -#include - -namespace Calamares { - -DebugWindow::DebugWindow() - : QWidget( nullptr ) -{ - setupUi( this ); - - // GlobalStorage page - QJsonModel* jsonModel = new QJsonModel( this ); - - globalStorageView->setModel( jsonModel ); - GlobalStorage* gs = JobQueue::instance()->globalStorage(); - - connect( gs, &GlobalStorage::changed, [ = ] - { - jsonModel->loadJson( QJsonDocument::fromVariant( gs->m ).toJson() ); - globalStorageView->expandAll(); - } ); - jsonModel->loadJson( QJsonDocument::fromVariant( gs->m ).toJson() ); - globalStorageView->expandAll(); - - // JobQueue page - jobQueueText->setReadOnly( true ); - connect( JobQueue::instance(), &JobQueue::queueChanged, - [ this ]( const QList< Calamares::job_ptr >& jobs ) - { - QStringList text; - foreach( auto job, jobs ) - { - text.append( job->prettyName() ); - } - - 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 ); - setWindowTitle( tr( "Debug information" ) ); - ) -} - - -void -DebugWindow::closeEvent( QCloseEvent* e ) -{ - Q_UNUSED( e ) - emit closed(); -} - -} // namespace Calamares diff --git a/src/libcalamaresui/utils/DebugWindow.h b/src/libcalamaresui/utils/DebugWindow.h deleted file mode 100644 index ee06199..0000000 --- a/src/libcalamaresui/utils/DebugWindow.h +++ /dev/null @@ -1,45 +0,0 @@ -/* === This file is part of Calamares - === - * - * Copyright 2015, Teo Mrnjavac - * - * Calamares is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Calamares is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Calamares. If not, see . - */ - -#ifndef CALAMARES_DEBUGWINDOW_H -#define CALAMARES_DEBUGWINDOW_H - -#include "ui_DebugWindow.h" - -#include - -namespace Calamares { - -class DebugWindow : public QWidget, private Ui::DebugWindow -{ - Q_OBJECT - -public: - explicit DebugWindow(); - -signals: - void closed(); - -protected: - void closeEvent( QCloseEvent* e ) override; - -}; - - -} // namespace Calamares -#endif // CALAMARES_DEBUGWINDOW_H diff --git a/src/libcalamaresui/utils/DebugWindow.ui b/src/libcalamaresui/utils/DebugWindow.ui deleted file mode 100644 index a445e8a..0000000 --- a/src/libcalamaresui/utils/DebugWindow.ui +++ /dev/null @@ -1,61 +0,0 @@ - - - Calamares::DebugWindow - - - - 0 - 0 - 632 - 497 - - - - Form - - - - - - 0 - - - - GlobalStorage - - - - - - - - - - JobQueue - - - - - - - - - - Modules - - - - - - - - - - - - - - - - -