File indexing completed on 2024-05-12 05:54:31
0001 /* 0002 SPDX-FileCopyrightText: 2004 Csaba Karai <krusader@users.sourceforge.net> 0003 SPDX-FileCopyrightText: 2004-2022 Krusader Krew <https://krusader.org> 0004 0005 SPDX-License-Identifier: GPL-2.0-or-later 0006 */ 0007 0008 #ifndef KGPROTOCOLS_H 0009 #define KGPROTOCOLS_H 0010 0011 // QtWidgets 0012 #include <QPushButton> 0013 0014 #include "../GUI/krlistwidget.h" 0015 #include "../GUI/krtreewidget.h" 0016 #include "konfiguratorpage.h" 0017 0018 class KgProtocols : public KonfiguratorPage 0019 { 0020 Q_OBJECT 0021 0022 public: 0023 explicit KgProtocols(bool first, QWidget *parent = nullptr); 0024 0025 void loadInitialValues() override; 0026 void setDefaults() override; 0027 bool apply() override; 0028 bool isChanged() override; 0029 0030 static void init(); 0031 0032 public slots: 0033 void slotDisableButtons(); 0034 void slotAddProtocol(); 0035 void slotRemoveProtocol(); 0036 void slotAddMime(); 0037 void slotRemoveMime(); 0038 0039 protected: 0040 void loadProtocols(); 0041 void loadMimes(); 0042 void addSpacer(QBoxLayout *parent); 0043 0044 void addProtocol(const QString &name, bool changeCurrent = false); 0045 void removeProtocol(const QString &name); 0046 void addMime(QString name, const QString &protocol); 0047 void removeMime(const QString &name); 0048 0049 KrTreeWidget *linkList; 0050 0051 KrListWidget *protocolList; 0052 KrListWidget *mimeList; 0053 0054 QPushButton *btnAddProtocol; 0055 QPushButton *btnRemoveProtocol; 0056 QPushButton *btnAddMime; 0057 QPushButton *btnRemoveMime; 0058 }; 0059 0060 #endif /* __KgProtocols_H__ */