File indexing completed on 2024-12-01 13:34:34

0001 /*
0002  *   SPDX-FileCopyrightText: 2000 Matthias Elter <elter@kde.org>
0003  *
0004  *   SPDX-License-Identifier: GPL-2.0-or-later
0005  *
0006  */
0007 
0008 #ifndef basictab_h
0009 #define basictab_h
0010 
0011 #include <KService>
0012 #include <QKeySequence>
0013 #include <QTabWidget>
0014 
0015 class KKeySequenceWidget;
0016 class QLineEdit;
0017 class KIconButton;
0018 class QCheckBox;
0019 class QGroupBox;
0020 class QLabel;
0021 class KUrlRequester;
0022 class KLineSpellChecking;
0023 
0024 class MenuFolderInfo;
0025 class MenuEntryInfo;
0026 
0027 class BasicTab : public QTabWidget
0028 {
0029     Q_OBJECT
0030 
0031 public:
0032     explicit BasicTab(QWidget *parent = nullptr);
0033 
0034     void apply();
0035 
0036     void updateHiddenEntry(bool show);
0037 
0038 Q_SIGNALS:
0039     void changed(MenuFolderInfo *);
0040     void changed(MenuEntryInfo *);
0041     void findServiceShortcut(const QKeySequence &, KService::Ptr &);
0042 
0043 public Q_SLOTS:
0044     void setFolderInfo(MenuFolderInfo *folderInfo);
0045     void setEntryInfo(MenuEntryInfo *entryInfo);
0046     void slotDisableAction();
0047 protected Q_SLOTS:
0048     void slotChanged();
0049     void launchcb_clicked();
0050     void termcb_clicked();
0051     void uidcb_clicked();
0052     void slotCapturedKeySequence(const QKeySequence &);
0053     void slotExecSelected();
0054     void onlyshowcb_clicked();
0055     void hiddenentrycb_clicked();
0056 
0057 protected:
0058     /**
0059      * @brief Initializes the general tab.
0060      */
0061     void initGeneralTab();
0062 
0063     /**
0064      * @brief Initializes the advanced tab.
0065      */
0066     void initAdvancedTab();
0067 
0068     /**
0069      * @brief Initializes connections.
0070      */
0071     void initConnections();
0072     void enableWidgets(bool isDF, bool isDeleted);
0073 
0074 protected:
0075     QLineEdit *_nameEdit = nullptr;
0076     KLineSpellChecking *_commentEdit = nullptr;
0077     KLineSpellChecking *_descriptionEdit = nullptr;
0078     KKeySequenceWidget *_keyBindingEdit = nullptr;
0079     KUrlRequester *_programEdit, *_pathEdit = nullptr;
0080     QLineEdit *_envarsEdit = nullptr;
0081     QLineEdit *_argsEdit = nullptr;
0082     QLineEdit *_terminalOptionsEdit = nullptr;
0083     QLineEdit *_userNameEdit = nullptr;
0084     QCheckBox *_terminalCB = nullptr;
0085     QCheckBox *_userCB = nullptr;
0086     QCheckBox *_launchCB = nullptr;
0087     QCheckBox *_onlyShowInKdeCB = nullptr;
0088     QCheckBox *_hiddenEntryCB = nullptr;
0089     KIconButton *_iconButton = nullptr;
0090     QGroupBox *_workPathGroup = nullptr;
0091     QGroupBox *_terminalGroup = nullptr;
0092     QGroupBox *_userGroup = nullptr;
0093     QGroupBox *_keyBindingGroup = nullptr;
0094     QLabel *_terminalOptionsLabel = nullptr;
0095     QLabel *_userNameLabel = nullptr;
0096     QLabel *_pathLabel = nullptr;
0097     QLabel *_nameLabel = nullptr;
0098     QLabel *_commentLabel = nullptr;
0099     QLabel *_programLabel = nullptr;
0100     QLabel *_envarsLabel = nullptr;
0101     QLabel *_argsLabel = nullptr;
0102     QLabel *_keyBindingLabel = nullptr;
0103     QLabel *_descriptionLabel = nullptr;
0104 
0105     MenuFolderInfo *_menuFolderInfo = nullptr;
0106     MenuEntryInfo *_menuEntryInfo = nullptr;
0107 };
0108 
0109 #endif