File indexing completed on 2024-04-28 04:51:29

0001 /*
0002 SPDX-FileCopyrightText: 2023 Jean-Baptiste Mardelle <jb@kdenlive.org>
0003 This file is part of Kdenlive. See www.kdenlive.org.
0004 
0005 SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0006 */
0007 
0008 #pragma once
0009 
0010 #include <KDirOperator>
0011 #include <QTimer>
0012 
0013 class KUrlNavigator;
0014 class KUrlComboBox;
0015 class KFileFilterCombo;
0016 
0017 /**
0018  * @class MediaBrowser
0019  * @brief The bin widget takes care of both item model and view upon project opening.
0020  */
0021 class MediaBrowser : public QWidget
0022 {
0023     Q_OBJECT
0024 
0025 public:
0026     explicit MediaBrowser(QWidget *parent = nullptr);
0027     ~MediaBrowser() override;
0028     const QUrl url() const;
0029     void setUrl(const QUrl url);
0030     void back();
0031     void forward();
0032     /** @brief create a map of all actions having shortcut conflicts between Kdenlive's actioncollection and the KDirOperator */
0033 
0034 protected:
0035     bool eventFilter(QObject *obj, QEvent *event) override;
0036 
0037 private:
0038     KDirOperator *m_op;
0039     KUrlNavigator *m_locationEdit;
0040     KFileFilterCombo *m_filterCombo;
0041     KUrlComboBox *m_filenameEdit;
0042     QTimer m_filterDelayTimer;
0043     QList<QAction *> m_browserActions;
0044     QList<QAction *> m_conflictingAppActions;
0045     void importSelection();
0046     void openExternalFile(const QUrl &url);
0047     void enableAppShortcuts();
0048     void disableAppShortcuts();
0049 public Q_SLOTS:
0050     void detectShortcutConflicts();
0051 
0052 private Q_SLOTS:
0053     void slotFilterChanged();
0054     void slotLocationChanged(const QString &text);
0055     void slotUrlEntered(const QUrl &url);
0056     void connectView();
0057     void slotViewDoubleClicked();
0058 };