From 725ca9791ec516f1bb0c5a37ec17fbedd888d928 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 13 Oct 2016 13:10:34 -0400 Subject: Another large update to lumina-fm: Have all file operations performed in the background, and show up within a new system tray icon *if* the operation lasts longer than 1 second (automatic cleanup for short ops). --- src-qt5/desktop-utils/lumina-fm/OPWidget.h | 59 ++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 src-qt5/desktop-utils/lumina-fm/OPWidget.h (limited to 'src-qt5/desktop-utils/lumina-fm/OPWidget.h') diff --git a/src-qt5/desktop-utils/lumina-fm/OPWidget.h b/src-qt5/desktop-utils/lumina-fm/OPWidget.h new file mode 100644 index 00000000..600df4b7 --- /dev/null +++ b/src-qt5/desktop-utils/lumina-fm/OPWidget.h @@ -0,0 +1,59 @@ +//=========================================== +// 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" +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; + //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 -- cgit