forked from ibsh/is_KeyFinder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
guibatch.h
142 lines (107 loc) · 3.47 KB
/
guibatch.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
/*************************************************************************
Copyright 2011 Ibrahim Sha'ath
This file is part of KeyFinder.
KeyFinder is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
KeyFinder is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with KeyFinder. If not, see <http://www.gnu.org/licenses/>.
*************************************************************************/
#ifndef BATCHWINDOW_H
#define BATCHWINDOW_H
// forward declaration for circular dependency
class MainMenuHandler;
#include <QtCore>
#include <QMainWindow>
#include <QThread>
#include <QDragEnterEvent>
#include <QDropEvent>
#include <QUrl>
#include <QFuture>
#include <QFutureWatcher>
#include <QClipboard>
#include <QMessageBox>
#include <QLabel>
#include <QtNetwork/QNetworkReply>
#include "guidetail.h"
#include "guimenuhandler.h"
#include "preferences.h"
#include "asynckeyprocess.h"
#include "asyncmetadatareadprocess.h"
#include "metadatataglib.h"
#include "externalplaylist.h"
#include "_VERSION.h"
namespace Ui {
class BatchWindow;
}
class BatchWindow : public QMainWindow{
Q_OBJECT
public:
explicit BatchWindow(MainMenuHandler* handler, QWidget* parent = 0);
bool receiveUrls(const QList<QUrl>&);
~BatchWindow();
public slots:
void checkForNewVersion();
private:
void closeEvent(QCloseEvent*);
Preferences prefs;
void setGuiDefaults();
void setGuiRunning(const QString&, bool);
void sortTableWidget();
int libraryOldIndex;
QFutureWatcher<QList<ExternalPlaylistObject> > readLibraryWatcher;
QFutureWatcher<QList<QUrl> > loadPlaylistWatcher;
void dragEnterEvent(QDragEnterEvent*);
void dropEvent(QDropEvent*);
QList<QUrl> droppedFiles;
void addDroppedFiles();
QFutureWatcher<void> addFilesWatcher;
QList<QUrl> getDirectoryContents(QDir) const;
void addNewRow(QString);
QFutureWatcher<MetadataReadResult> metadataReadWatcher;
void readMetadata();
QFutureWatcher<KeyFinderResultWrapper> analysisWatcher;
void checkRowsForSkipping();
bool checkFieldForMetadata(int, int, metadata_write_t);
void markRowSkipped(int,bool);
void runAnalysis();
bool writeToTagsAtRow(int, int);
bool writeToFilenameAtRow(int, int);
// UI
Ui::BatchWindow* ui;
QPointer<QLabel> initialHelpLabel;
MainMenuHandler* menuHandler;
QBrush keyFinderRow;
QBrush keyFinderAltRow;
QBrush textDefault;
QBrush textSuccess;
QBrush textError;
bool allowSort;
int sortColumn;
private slots:
void on_libraryWidget_cellClicked(int,int);
void headerClicked(int);
void readLibraryFinished();
void loadPlaylistFinished();
void addFilesFinished();
void on_runBatchButton_clicked();
void on_cancelBatchButton_clicked();
void copySelectedFromTableWidget();
void writeDetectedToFiles();
void clearDetected();
void deleteSelectedRows();
void runDetailedAnalysis();
void analysisFinished();
void analysisResultReadyAt(int);
void metadataReadFinished();
void metadataReadResultReadyAt(int);
void progressRangeChanged(int, int);
void progressValueChanged(int);
void receiveNetworkReply(QNetworkReply*);
};
#endif