File indexing completed on 2024-05-05 05:00:08

0001 /* General options (for both fm and web modes) konqueror options
0002 
0003     SPDX-FileCopyrightText: 1998 Sven Radej
0004     SPDX-FileCopyrightText: 1998 David Faure
0005     SPDX-FileCopyrightText: 2007 Nick Shaforostoff
0006 
0007 */
0008 
0009 #ifndef GENERALOPTS_H
0010 #define GENERALOPTS_H
0011 
0012 #include <QCheckBox>
0013 
0014 #include <kcmodule.h>
0015 #include <ksharedconfig.h>
0016 
0017 class QComboBox;
0018 class QLineEdit;
0019 class QVBoxLayout;
0020 class KMessageWidget;
0021 class QCheckBox;
0022 
0023 class KKonqGeneralOptions : public KCModule
0024 {
0025     Q_OBJECT
0026 
0027 public:
0028     //TODO KF6: when dropping compatibility with KF5, remove QVariantList argument
0029     KKonqGeneralOptions(QObject *parent, const KPluginMetaData &md={}, const QVariantList &args={});
0030     ~KKonqGeneralOptions() override;
0031     void load() override;
0032     void save() override;
0033     void defaults() override;
0034 
0035 #if QT_VERSION_MAJOR < 6
0036     void setNeedsSave(bool needs) {emit changed(needs);}
0037 #endif
0038 
0039 private Q_SLOTS:
0040     void slotChanged();
0041     void displayEmpytStartPageWarningIfNeeded();
0042 
0043 private:
0044     void addHomeUrlWidgets(QVBoxLayout *);
0045 
0046     KSharedConfig::Ptr m_pConfig;
0047 
0048     QComboBox *m_startCombo;
0049     QLineEdit *homeURL;
0050     QLineEdit *startURL;
0051     QComboBox *m_webEngineCombo;
0052     QComboBox *m_splitBehaviour;
0053     KMessageWidget *m_emptyStartUrlWarning;
0054     QCheckBox *m_restoreLastState;
0055 };
0056 
0057 #endif // GENERALOPTS_H