digiKam
queuemgrwindow.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2008-11-21
7  * Description : Batch Queue Manager GUI
8  *
9  * Copyright (C) 2008-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  *
11  * This program is free software; you can redistribute it
12  * and/or modify it under the terms of the GNU General
13  * Public License as published by the Free Software Foundation;
14  * either version 2, or (at your option)
15  * any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * ============================================================ */
23 
24 #ifndef DIGIKAM_BQM_QUEUE_MGR_WINDOW_H
25 #define DIGIKAM_BQM_QUEUE_MGR_WINDOW_H
26 
27 // Qt includes
28 
29 #include <QMap>
30 #include <QString>
31 #include <QCloseEvent>
32 #include <QUrl>
33 
34 // Local includes
35 
36 #include "iteminfo.h"
37 #include "setup.h"
38 #include "dhistoryview.h"
39 #include "dxmlguiwindow.h"
40 
41 class QAction;
42 
43 namespace Digikam
44 {
45 
46 class ActionData;
47 class BatchToolsFactory;
48 class AssignedBatchTools;
49 class QueueListViewItem;
50 
52 {
53  Q_OBJECT
54 
55 public:
56 
57  ~QueueMgrWindow() override;
58 
60  static bool queueManagerWindowCreated();
61 
62  void addNewQueue();
63  void loadItemInfos(const ItemInfoList& list, int queueId);
64  void loadItemInfosToCurrentQueue(const ItemInfoList& list);
65  void loadItemInfosToNewQueue(const ItemInfoList& list);
66  void refreshView();
67  void applySettings();
68 
72  QMap<int, QString> queuesMap() const;
73 
74  bool isBusy() const;
75  int currentQueueId() const;
76 
77  bool queryClose() override;
78 
79 public:
80 
82  {
83  // Reimplemented in BatchToolsFactory
84  return nullptr;
85  };
86 
87 Q_SIGNALS:
88 
90  void signalBqmIsBusy(bool);
91 
92 protected:
93 
94  void moveEvent(QMoveEvent* e) override;
95 
96 public Q_SLOTS:
97 
98  void slotRun();
99  void slotRunAll();
100  void slotStop();
101  void slotAssignQueueSettings(const QString&);
102 
103 private:
104 
105  void customizedFullScreenMode(bool set) override;
106  void closeEvent(QCloseEvent* e) override;
107  void setupActions();
108  void setupConnections();
109  void setupUserArea();
110  void setupStatusBar();
111  void readSettings();
112  void writeSettings();
113  void refreshStatusBar();
114  void populateToolsList();
115  void setup(Setup::Page page);
116  void addHistoryMessage(QueueListViewItem* const cItem,
117  const QString& msg,
119 
120  bool checkTargetAlbum(int queueId);
121  void busy(bool busy);
122  void processOneQueue();
123  void processingAborted();
124 
125  QueueMgrWindow();
126 
127 private Q_SLOTS:
128 
129  void slotSetup() override;
130  void slotComponentsInfo() override;
131  void slotDBStat() override;
132  void slotOnlineVersionCheck() override;
133  void slotAction(const Digikam::ActionData&);
134  void slotHistoryEntryClicked(int, qlonglong);
135  void slotAssignedToolsChanged(const AssignedBatchTools&);
136  void slotQueueContentsChanged();
137  void slotItemSelectionChanged();
138  void slotQueueProcessed();
139  void slotSaveWorkflow();
140 
141 private:
142 
143  // Disable
144  QueueMgrWindow(QWidget*) = delete;
145 
146 private:
147 
148  class Private;
149  Private* const d;
150 
151  static QueueMgrWindow* m_instance;
152 };
153 
154 } // namespace Digikam
155 
156 #endif // DIGIKAM_BQM_QUEUE_MGR_WINDOW_H
Definition: actions.h:37
Definition: batchtoolutils.h:91
EntryType
Definition: dhistoryview.h:48
Definition: dinfointerface.h:56
Definition: dpluginaction.h:40
Definition: dxmlguiwindow.h:98
Definition: iteminfolist.h:47
Definition: queuelist.h:49
Definition: queuemgrwindow_p.h:107
Definition: queuemgrwindow.h:52
void slotAssignQueueSettings(const QString &)
Definition: queuemgrwindow.cpp:1018
void slotStop()
Definition: queuemgrwindow.cpp:979
bool isBusy() const
Definition: queuemgrwindow.cpp:105
void loadItemInfosToNewQueue(const ItemInfoList &list)
Definition: queuemgrwindow.cpp:576
void loadItemInfosToCurrentQueue(const ItemInfoList &list)
Definition: queuemgrwindow.cpp:566
int currentQueueId() const
Definition: queuemgrwindow.cpp:551
static QueueMgrWindow * queueManagerWindow()
Definition: queuemgrwindow.cpp:31
void loadItemInfos(const ItemInfoList &list, int queueId)
Definition: queuemgrwindow.cpp:556
static bool queueManagerWindowCreated()
Definition: queuemgrwindow.cpp:41
void slotRun()
Definition: queuemgrwindow.cpp:621
void applySettings()
Definition: queuemgrwindow.cpp:412
bool queryClose() override
Definition: queuemgrwindow.cpp:525
void addNewQueue()
Definition: queuemgrwindow.cpp:546
void moveEvent(QMoveEvent *e) override
Definition: queuemgrwindow.cpp:868
void refreshView()
Definition: queuemgrwindow.cpp:382
void slotRunAll()
Definition: queuemgrwindow.cpp:670
~QueueMgrWindow() override
Definition: queuemgrwindow.cpp:89
QMap< int, QString > queuesMap() const
Definition: queuemgrwindow.cpp:95
DInfoInterface * infoIface(DPluginAction *const) override
Definition: queuemgrwindow.h:81
Page
Definition: setup.h:46
Definition: datefolderview.cpp:43