#ifndef MPROGRAMMANAGER_H #define MPROGRAMMANAGER_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "loappconfig.h" #include #include #include #include namespace Ui { class mProgramManager; } class mProgramManager : public QWidget { Q_OBJECT public: explicit mProgramManager(QWidget *parent = nullptr); ~mProgramManager(); public: virtual void paintEvent(QPaintEvent *); protected: void isAllChecked(); QString convertFileSize(int n); bool checkIfNameRepeated(const QString &name, QTreeWidgetItem *skip = nullptr); QTreeWidgetItem *checkIfProgramChecked(); bool addProgram(QTreeWidgetItem *item, QString name, QSize res, QString fSize, QString eLast); void setProgram(QTreeWidgetItem *item, QString name, QSize res, QString fSize, QString eLast); void editHead(QTreeWidgetItem *item, QString name, QSize res, QString remarks); protected slots: void onNewClicked(bool f); void onEditClicked(bool f); void onDeleteClicked(bool f); void onEditHead(QString name, QSize res, QString remarks); void onRestoreProgram(const QJsonDocument &pro); void onCreateNewProgram(QString name, QSize res, QString remarks); void onCheckAll(bool checked); void onItemClicked(QTreeWidgetItem *item, int column); void onEditProgram(LoQPushButton *obj, bool f); void onProgramChanged(); private: Ui::mProgramManager *ui; QCheckBox *m_bnSelectAll; QTreeWidgetItem *m_itemEditing; QString m_pRoot; }; #endif // MPROGRAMMANAGER_H