aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils/lumina-fm/OPWidget.h
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2016-10-13 13:10:34 -0400
committerKen Moore <ken@pcbsd.org>2016-10-13 13:10:34 -0400
commit725ca9791ec516f1bb0c5a37ec17fbedd888d928 (patch)
tree6f8e9ca53b4546c1c16ce04ee25ad5a1d6bfca9b /src-qt5/desktop-utils/lumina-fm/OPWidget.h
parentAdd a "launch" option within the context menu for applauncher desktop plugins. (diff)
downloadlumina-725ca9791ec516f1bb0c5a37ec17fbedd888d928.tar.gz
lumina-725ca9791ec516f1bb0c5a37ec17fbedd888d928.tar.bz2
lumina-725ca9791ec516f1bb0c5a37ec17fbedd888d928.zip
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).
Diffstat (limited to 'src-qt5/desktop-utils/lumina-fm/OPWidget.h')
-rw-r--r--src-qt5/desktop-utils/lumina-fm/OPWidget.h59
1 files changed, 59 insertions, 0 deletions
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
bgstack15