summaryrefslogtreecommitdiff
path: root/app-admin/calamares/files/calamares-disable-debug-window.patch
blob: 13309b2c253c64c090fe015ab8e0812df8b3782a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
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 <QApplication>
@@ -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 <QPointer>
 #include <QWidget>
 
-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 - <http://github.com/calamares> ===
- *
- *   Copyright 2015, Teo Mrnjavac <teo@kde.org>
- *
- *   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 <http://www.gnu.org/licenses/>.
- */
-
-#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 <QJsonDocument>
-#include <QSplitter>
-#include <QStringListModel>
-#include <QTreeView>
-
-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 - <http://github.com/calamares> ===
- *
- *   Copyright 2015, Teo Mrnjavac <teo@kde.org>
- *
- *   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 <http://www.gnu.org/licenses/>.
- */
-
-#ifndef CALAMARES_DEBUGWINDOW_H
-#define CALAMARES_DEBUGWINDOW_H
-
-#include "ui_DebugWindow.h"
-
-#include <QWidget>
-
-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 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>Calamares::DebugWindow</class>
- <widget class="QWidget" name="Calamares::DebugWindow">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>632</width>
-    <height>497</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>Form</string>
-  </property>
-  <layout class="QVBoxLayout" name="verticalLayout">
-   <item>
-    <widget class="QTabWidget" name="tabWidget">
-     <property name="currentIndex">
-      <number>0</number>
-     </property>
-     <widget class="QWidget" name="globalStorageTab">
-      <attribute name="title">
-       <string>GlobalStorage</string>
-      </attribute>
-      <layout class="QVBoxLayout" name="verticalLayout_2">
-       <item>
-        <widget class="QTreeView" name="globalStorageView"/>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="jobQueueTab">
-      <attribute name="title">
-       <string>JobQueue</string>
-      </attribute>
-      <layout class="QVBoxLayout" name="verticalLayout_3">
-       <item>
-        <widget class="QTextEdit" name="jobQueueText"/>
-       </item>
-      </layout>
-     </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>
-   </item>
-  </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>