1 ///////////////////////////////////////////////////////////////////////////////
2 // LameXP - Audio Encoder Front-End
3 // Copyright (C) 2004-2017 LoRd_MuldeR <MuldeR2@GMX.de>
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version, but always including the *additional*
9 // restrictions defined in the "License.txt" file.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with this program; if not, write to the Free Software Foundation, Inc.,
18 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 // http://www.gnu.org/licenses/gpl-2.0.txt
21 ///////////////////////////////////////////////////////////////////////////////
25 #include <QAbstractTableModel>
28 #include <QStringList>
35 class ProgressModel
: public QAbstractTableModel
58 SysMsg_Performance
= 1,
63 int columnCount(const QModelIndex
&parent
= QModelIndex()) const;
64 int rowCount(const QModelIndex
&parent
= QModelIndex()) const;
65 QVariant
data(const QModelIndex
&index
, int role
= Qt::DisplayRole
) const;
66 QVariant
headerData(int section
, Qt::Orientation orientation
, int role
= Qt::DisplayRole
) const;
69 const QStringList
&getLogFile(const QModelIndex
&index
) const;
70 const QUuid
&getJobId(const QModelIndex
&index
) const;
71 const JobState
getJobState(const QModelIndex
&index
) const;
72 const QIcon
&getIcon(ProgressModel::JobState state
) const;
73 void restoreHiddenItems(void);
76 void addJob(const QUuid
&jobId
, const QString
&jobName
, const QString
&jobInitialStatus
= QString("Initializing..."), int jobInitialState
= JobRunning
);
77 void updateJob(const QUuid
&jobId
, const QString
&newStatus
, int newState
);
78 void appendToLog(const QUuid
&jobId
, const QString
&line
);
79 void addSystemMessage(const QString
&text
, int type
= SysMsg_Info
);
82 QList
<QUuid
> m_jobList
;
83 QList
<QUuid
> m_jobListHidden
;
84 QHash
<QUuid
, QString
> m_jobName
;
85 QHash
<QUuid
, QString
> m_jobStatus
;
86 QHash
<QUuid
, int> m_jobState
;
87 QHash
<QUuid
, QStringList
> m_jobLogFile
;
88 QHash
<QUuid
, int> m_jobIndexCache
;
89 QSet
<QUuid
> m_jobIdentifiers
;
91 const QIcon m_iconRunning
;
92 const QIcon m_iconPaused
;
93 const QIcon m_iconComplete
;
94 const QIcon m_iconFailed
;
95 const QIcon m_iconSystem
;
96 const QIcon m_iconWarning
;
97 const QIcon m_iconPerformance
;
98 const QIcon m_iconSkipped
;
99 const QIcon m_iconUndefined
;
101 const QStringList m_emptyList
;
102 const QUuid m_emptyUuid
;