File indexing completed on 2024-04-28 04:52:14
0001 0002 /* 0003 SPDX-FileCopyrightText: 2016 Jean-Baptiste Mardelle <jb@kdenlive.org> 0004 This file is part of Kdenlive. See www.kdenlive.org. 0005 0006 SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0007 */ 0008 0009 #pragma once 0010 0011 #include "dialogs/profilesdialog.h" 0012 #include <memory> 0013 0014 #include <QWidget> 0015 0016 class QTextEdit; 0017 class ProfileTreeModel; 0018 class ProfileFilter; 0019 class TreeView; 0020 class QTreeView; 0021 0022 /** @class ProfileWidget 0023 @brief Provides interface to choose and filter profiles 0024 @author Jean-Baptiste Mardelle, Nicolas Carion 0025 */ 0026 class ProfileWidget : public QWidget 0027 { 0028 Q_OBJECT 0029 public: 0030 explicit ProfileWidget(QWidget *parent = nullptr); 0031 ~ProfileWidget() override; 0032 void loadProfile(const QString &profile); 0033 const QString selectedProfile() const; 0034 0035 private: 0036 /** @brief currently selected's profile path */ 0037 QString m_currentProfile; 0038 QString m_lastValidProfile; 0039 QString m_originalProfile; 0040 void slotUpdateInfoDisplay(); 0041 0042 QComboBox *m_fpsFilt; 0043 QComboBox *m_scanningFilt; 0044 0045 QTreeView *m_treeView; 0046 std::shared_ptr<ProfileTreeModel> m_treeModel; 0047 ProfileFilter *m_filter; 0048 0049 QTextEdit *m_descriptionPanel; 0050 0051 /** @brief Open project profile management dialog. */ 0052 void slotEditProfiles(); 0053 0054 /** @brief Manage a change in the selection */ 0055 void slotChangeSelection(const QModelIndex ¤t, const QModelIndex &previous); 0056 /** @brief Fill the description of the profile. 0057 @param profile_path is the path to the profile 0058 */ 0059 void fillDescriptionPanel(const QString &profile_path); 0060 0061 /** @brief Select the profile with given path. Returns true on success */ 0062 bool trySelectProfile(const QString &profile); 0063 0064 /** @brief Slot to be called whenever filtering changes */ 0065 void slotFilterChanged(); 0066 0067 /** @brief Reload available fps values */ 0068 void refreshFpsCombo(); 0069 0070 Q_SIGNALS: 0071 void profileChanged(); 0072 };