1 /* 2 * SPDX-FileCopyrightText: 2000 Matthias Elter <elter@kde.org> 3 * 4 * SPDX-License-Identifier: GPL-2.0-or-later 5 * 6 */ 7 8 #ifndef basictab_h 9 #define basictab_h 10 11 #include <KService> 12 #include <QKeySequence> 13 #include <QTabWidget> 14 15 class KKeySequenceWidget; 16 class QLineEdit; 17 class KIconButton; 18 class QCheckBox; 19 class QGroupBox; 20 class QLabel; 21 class KUrlRequester; 22 class KService; 23 class KLineSpellChecking; 24 25 class MenuFolderInfo; 26 class MenuEntryInfo; 27 28 class BasicTab : public QTabWidget 29 { 30 Q_OBJECT 31 32 public: 33 explicit BasicTab(QWidget *parent = nullptr); 34 35 void apply(); 36 37 void updateHiddenEntry(bool show); 38 39 Q_SIGNALS: 40 void changed(MenuFolderInfo *); 41 void changed(MenuEntryInfo *); 42 void findServiceShortcut(const QKeySequence &, KService::Ptr &); 43 44 public Q_SLOTS: 45 void setFolderInfo(MenuFolderInfo *folderInfo); 46 void setEntryInfo(MenuEntryInfo *entryInfo); 47 void slotDisableAction(); 48 protected Q_SLOTS: 49 void slotChanged(); 50 void launchcb_clicked(); 51 void termcb_clicked(); 52 void uidcb_clicked(); 53 void slotCapturedKeySequence(const QKeySequence &); 54 void slotExecSelected(); 55 void onlyshowcb_clicked(); 56 void hiddenentrycb_clicked(); 57 58 protected: 59 /** 60 * @brief Initializes the general tab. 61 */ 62 void initGeneralTab(); 63 64 /** 65 * @brief Initializes the advanced tab. 66 */ 67 void initAdvancedTab(); 68 69 /** 70 * @brief Initializes connections. 71 */ 72 void initConnections(); 73 void enableWidgets(bool isDF, bool isDeleted); 74 75 protected: 76 QLineEdit *_nameEdit = nullptr; 77 KLineSpellChecking *_commentEdit = nullptr; 78 KLineSpellChecking *_descriptionEdit = nullptr; 79 KKeySequenceWidget *_keyBindingEdit = nullptr; 80 KUrlRequester *_execEdit, *_pathEdit = nullptr; 81 QLineEdit *_terminalOptionsEdit = nullptr; 82 QLineEdit *_userNameEdit = nullptr; 83 QCheckBox *_terminalCB = nullptr; 84 QCheckBox *_userCB = nullptr; 85 QCheckBox *_launchCB = nullptr; 86 QCheckBox *_onlyShowInKdeCB = nullptr; 87 QCheckBox *_hiddenEntryCB = nullptr; 88 KIconButton *_iconButton = nullptr; 89 QGroupBox *_workPathGroup = nullptr; 90 QGroupBox *_terminalGroup = nullptr; 91 QGroupBox *_userGroup = nullptr; 92 QGroupBox *_keyBindingGroup = nullptr; 93 QLabel *_terminalOptionsLabel = nullptr; 94 QLabel *_userNameLabel = nullptr; 95 QLabel *_pathLabel = nullptr; 96 QLabel *_nameLabel = nullptr; 97 QLabel *_commentLabel = nullptr; 98 QLabel *_execLabel = nullptr; 99 QLabel *_keyBindingLabel = nullptr; 100 QLabel *_descriptionLabel = nullptr; 101 102 MenuFolderInfo *_menuFolderInfo = nullptr; 103 MenuEntryInfo *_menuEntryInfo = nullptr; 104 }; 105 106 #endif 107