Warning, file /system/kcm-grub2/src/kcm_grub2.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*******************************************************************************
0002  * Copyright (C) 2008-2013 Konstantinos Smanis <konstantinos.smanis@gmail.com> *
0003  *                                                                             *
0004  * This program is free software: you can redistribute it and/or modify it     *
0005  * under the terms of the GNU General Public License as published by the Free  *
0006  * Software Foundation, either version 3 of the License, or (at your option)   *
0007  * any later version.                                                          *
0008  *                                                                             *
0009  * This program is distributed in the hope that it will be useful, but WITHOUT *
0010  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or       *
0011  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for    *
0012  * more details.                                                               *
0013  *                                                                             *
0014  * You should have received a copy of the GNU General Public License along     *
0015  * with this program. If not, see <http://www.gnu.org/licenses/>.              *
0016  *******************************************************************************/
0017 
0018 #ifndef KCMGRUB2_H
0019 #define KCMGRUB2_H
0020 
0021 #include <KCModule>
0022 #include <QBitArray>
0023 
0024 // Project
0025 class Entry;
0026 
0027 // Ui
0028 namespace Ui
0029 {
0030 class KCMGRUB2;
0031 }
0032 
0033 class KCMGRUB2 : public KCModule
0034 {
0035     Q_OBJECT
0036 public:
0037     explicit KCMGRUB2(QObject *parent, const KPluginMetaData &data, const QVariantList &list);
0038     virtual ~KCMGRUB2();
0039 
0040     void defaults() override;
0041     void load() override;
0042     void save() override;
0043 private Q_SLOTS:
0044     void slotRemoveOldEntries();
0045     void slotGrubSavedefaultChanged();
0046     void slotGrubHiddenTimeoutToggled(bool checked);
0047     void slotGrubHiddenTimeoutChanged();
0048     void slotGrubHiddenTimeoutQuietChanged();
0049     void slotGrubTimeoutToggled(bool checked);
0050     void slotGrubTimeoutChanged();
0051     void slotGrubLanguageChanged();
0052     void slotGrubDisableRecoveryChanged();
0053     void slotMemtestChanged();
0054     void slotGrubDisableOsProberChanged();
0055     void slotGrubGfxmodeChanged();
0056     void slotGrubGfxpayloadLinuxChanged();
0057     void slotResolutionsRefresh();
0058     void slotGrubColorNormalChanged();
0059     void slotGrubColorHighlightChanged();
0060     void slowGrubBackgroundChanged();
0061     void slotPreviewGrubBackground();
0062     void slotCreateGrubBackground();
0063     void slotGrubThemeChanged();
0064     void slotGrubCmdlineLinuxDefaultChanged();
0065     void slotGrubCmdlineLinuxChanged();
0066     void slotGrubTerminalChanged();
0067     void slotGrubTerminalInputChanged();
0068     void slotGrubTerminalOutputChanged();
0069     void slotGrubDistributorChanged();
0070     void slotGrubSerialCommandChanged();
0071     void slotGrubInitTuneChanged();
0072     void slotGrubDisableLinuxUuidChanged();
0073     void slotInstallBootloader();
0074 
0075     void slotUpdateSuggestions();
0076     void slotTriggeredSuggestion(QAction *action);
0077 
0078 private:
0079     struct ColorInfo {
0080         QString grubColor;
0081         QString text;
0082         QColor color;
0083     };
0084     void setupColors(std::initializer_list<ColorInfo> colors);
0085     void setupObjects();
0086     void setupConnections();
0087 
0088     bool readFile(const QString &fileName, QByteArray &fileContents);
0089     void readAll();
0090 
0091     void showLocales();
0092     void sortResolutions();
0093     void showResolutions();
0094 
0095     QString parseTitle(const QString &line);
0096     void parseEntries(const QString &config);
0097     void parseSettings(const QString &config);
0098     void parseEnv(const QString &config);
0099 
0100     Ui::KCMGRUB2 *ui;
0101 
0102     enum {
0103         grubSavedefaultDirty,
0104         grubHiddenTimeoutDirty,
0105         grubHiddenTimeoutQuietDirty,
0106         grubTimeoutDirty,
0107         grubLocaleDirty,
0108         grubDisableRecoveryDirty,
0109         memtestDirty,
0110         grubDisableOsProberDirty,
0111         grubGfxmodeDirty,
0112         grubGfxpayloadLinuxDirty,
0113         grubColorNormalDirty,
0114         grubColorHighlightDirty,
0115         grubBackgroundDirty,
0116         grubThemeDirty,
0117         grubCmdlineLinuxDefaultDirty,
0118         grubCmdlineLinuxDirty,
0119         grubTerminalDirty,
0120         grubTerminalInputDirty,
0121         grubTerminalOutputDirty,
0122         grubDistributorDirty,
0123         grubSerialCommandDirty,
0124         grubInitTuneDirty,
0125         grubDisableLinuxUuidDirty,
0126         lastDirtyBit
0127     };
0128     QBitArray m_dirtyBits;
0129 
0130     QList<Entry> m_entries;
0131     QHash<QString, QString> m_settings;
0132     QHash<QString, QString> m_env;
0133     bool m_memtest;
0134     bool m_memtestOn;
0135     QHash<QString, QString> m_devices;
0136     QStringList m_resolutions;
0137     bool m_resolutionsEmpty;
0138     bool m_resolutionsForceRead;
0139     QStringList m_locales;
0140 };
0141 
0142 #endif