source: calamares/trunk/fuentes/src/calamares/CalamaresApplication.h @ 7538

Last change on this file since 7538 was 7538, checked in by kbut, 13 months ago

sync with github

File size: 2.3 KB
Line 
1/* === This file is part of Calamares - <https://github.com/calamares> ===
2 *
3 *   Copyright 2014-2015, Teo Mrnjavac <teo@kde.org>
4 *
5 *   Calamares is free software: you can redistribute it and/or modify
6 *   it under the terms of the GNU General Public License as published by
7 *   the Free Software Foundation, either version 3 of the License, or
8 *   (at your option) any later version.
9 *
10 *   Calamares is distributed in the hope that it will be useful,
11 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
12 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 *   GNU General Public License for more details.
14 *
15 *   You should have received a copy of the GNU General Public License
16 *   along with Calamares. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef CALAMARESAPPLICATION_H
20#define CALAMARESAPPLICATION_H
21
22#include "Typedefs.h"
23
24#include <QApplication>
25
26#define APP CalamaresApplication::instance()
27
28class CalamaresWindow;
29
30namespace Calamares
31{
32class ModuleManager;
33}
34
35
36/**
37 * @brief The CalamaresApplication class extends QApplication to handle
38 * Calamares startup and lifetime of main components.
39 */
40class CalamaresApplication : public QApplication
41{
42    Q_OBJECT
43public:
44    CalamaresApplication( int& argc, char* argv[] );
45    virtual ~CalamaresApplication();
46
47    /**
48     * @brief init handles the first part of Calamares application startup.
49     * After the main window shows up, the latter part of the startup sequence
50     * (including modules loading) happens asynchronously.
51     */
52    void init();
53    static CalamaresApplication* instance();
54
55    /**
56     * @brief setDebug controls whether debug mode is enabled
57     */
58    void setDebug( bool enabled );
59
60    /**
61     * @brief isDebug returns true if running in debug mode, otherwise false.
62     */
63    bool isDebug();
64
65    /**
66     * @brief mainWindow returns the Calamares application main window.
67     */
68    CalamaresWindow* mainWindow();
69
70private slots:
71    void initView();
72    void initViewSteps();
73    void initFailed( const QStringList& l );
74
75private:
76    void initQmlPath();
77    void initSettings();
78    void initBranding();
79    void initModuleManager();
80    void initJobQueue();
81
82    CalamaresWindow* m_mainwindow;
83    Calamares::ModuleManager* m_moduleManager;
84
85    bool m_debugMode;
86};
87
88#endif //CALAMARESAPPLICATION_H
Note: See TracBrowser for help on using the repository browser.