aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils/lumina-fm/OPWidget.h
blob: 4fdb7db85931d66a1bc67ad049aa2a07a04ea1e5 (plain)
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
//===========================================
//  Lumina-DE source code
//  Copyright (c) 2016, Ken Moore
//  Available under the 3-clause BSD license
//  See the LICENSE file for full details
//===========================================
//  This is the system tray icon for queueing/running file operations
//===========================================
#ifndef _LUMINA_FILE_MANAGER_FILE_OP_OPWIDGET_H
#define _LUMINA_FILE_MANAGER_FILE_OP_OPWIDGET_H

#include "FODialog.h"
#include "ScrollDialog.h"

#include <QWidgetAction>

namespace Ui{
	class OPWidget;
};

class OPWidget : public QWidget{
	Q_OBJECT
public:
	OPWidget(QWidget *parent = 0);
	~OPWidget();

	QWidgetAction* widgetAction(); //for loading the widget into a menu

	void setupOperation(QString optype, QStringList oldF, QStringList newF);

	bool isDone();

	//Status reporting after worker finishes
	bool hasErrors(); 
	float duration(); //in seconds
	QString finalStat(); //Final status message

public slots:
	void startOperation();

private:
	Ui::OPWidget *ui;
	ScrollDialog *dlg;
	//Main Objects
	QWidgetAction *WA;
	FOWorker *worker;
	QThread *workthread;
	//Bookkeeping items for statistics and such
	qint64 starttime, endtime;  //in ms
	QStringList Errors;
	QString tract; //translated action

private slots:
	void closeWidget();
	void showErrors();
	void opFinished(QStringList); //errors
	void opUpdate(int, int, QString, QString); //current, total, old file, new file

signals:
	void starting(QString);
	void finished(QString);
	void closed(QString);
};
#endif
bgstack15