File indexing completed on 2022-11-22 14:07:10

0001 /*
0002     SPDX-FileCopyrightText: 2021 Jean-Baptiste Mardelle <jb@kdenlive.org>
0003 
0004 SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005 */
0006 
0007 #pragma once
0008 
0009 #include "ui_testproxy_ui.h"
0010 
0011 #include "definitions.h"
0012 #include "utils/timecode.h"
0013 #include "widgets/timecodedisplay.h"
0014 
0015 #include <QProcess>
0016 #include <QMutex>
0017 
0018 class MyTreeWidgetItem : public QTreeWidgetItem {
0019   public:
0020   MyTreeWidgetItem(QTreeWidget* parent, const QStringList &list):QTreeWidgetItem(parent, list){}
0021   MyTreeWidgetItem(QTreeWidgetItem* parent, const QStringList &list):QTreeWidgetItem(parent, list){}
0022   private:
0023   bool operator<(const QTreeWidgetItem &other)const override {
0024      int column = treeWidget()->sortColumn();
0025      if (column == 0) {
0026          // Sorting by name
0027          return text(column).toLower() < other.text(column).toLower();
0028      }
0029      return data(column, Qt::UserRole).toInt() < other.data(column, Qt::UserRole).toInt();
0030   }
0031 };
0032 
0033 /**
0034  * @class ProxyTest
0035  * @brief A dialog to compare the proxy profiles.
0036  * @author Jean-Baptiste Mardelle
0037  */
0038 class ProxyTest : public QDialog, public Ui::TestProxy_UI
0039 {
0040     Q_OBJECT
0041 
0042 public:
0043     explicit ProxyTest(QWidget *parent = nullptr);
0044     ~ProxyTest() override;
0045 
0046 private slots:
0047     void startTest();
0048     void addAnalysis(const QStringList &data);
0049     void showMessage(const QString &message);
0050 
0051 private:
0052     bool m_closing;
0053     std::unique_ptr<QProcess> m_process;
0054     MyTreeWidgetItem *m_failedProfiles;
0055     QMutex m_locker;
0056 
0057 signals:
0058     void jobCanceled();
0059 };