itom  4.1.0
dialogPipManager.h
1 /* ********************************************************************
2  itom software
3  URL: http://www.uni-stuttgart.de/ito
4  Copyright (C) 2020, Institut fuer Technische Optik (ITO),
5  Universitaet Stuttgart, Germany
6 
7  This file is part of itom.
8 
9  itom is free software; you can redistribute it and/or modify it
10  under the terms of the GNU Library General Public Licence as published by
11  the Free Software Foundation; either version 2 of the Licence, or (at
12  your option) any later version.
13 
14  itom is distributed in the hope that it will be useful, but
15  WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
17  General Public Licence for more details.
18 
19  You should have received a copy of the GNU Library General Public License
20  along with itom. If not, see <http://www.gnu.org/licenses/>.
21 *********************************************************************** */
22 
23 #ifndef DIALOGPIPMANAGER_H
24 #define DIALOGPIPMANAGER_H
25 
26 #include "../../common/addInInterface.h"
27 #include "../../common/sharedStructures.h"
28 
29 #include "../models/pipManager.h"
30 
31 #include <qdialog.h>
32 #include <qvector.h>
33 #include <qevent.h>
34 #include <qcolor.h>
35 
36 #include "ui_dialogPipManager.h"
37 
38 namespace ito {
39 
40 class DialogPipManager : public QDialog
41 {
42  Q_OBJECT
43 
44  Q_PROPERTY(QColor colorMessage READ colorMessage WRITE setColorMessage DESIGNABLE true);
45  Q_PROPERTY(QColor colorError READ colorError WRITE setColorError DESIGNABLE true);
46 
47 public:
48  DialogPipManager(QWidget *parent = NULL, bool standalone = false);
50 
51  QColor colorMessage() { return m_colorMessage; }
52  void setColorMessage(const QColor &color);
53 
54  QColor colorError() { return m_colorError; }
55  void setColorError(const QColor &color);
56 
57 protected:
58  void closeEvent(QCloseEvent *e);
59  PipGeneralOptions createOptions() const;
60 
61  void installOrUpdatePackage(bool update = false);
62  QString exportPackageTableToString() const;
63 
64 private:
65  PipManager *m_pPipManager;
66  Ui::DialogPipManager ui;
67  QString m_logHtml;
68  PipManager::Task m_currentTask;
69  int m_lastLogEntry; //-1: nothing yet, 0: standard text, 1: error text
70  bool m_outputSilent;
71  bool m_standalone;
72  QColor m_colorMessage;
73  QColor m_colorError;
74 
75  static QString invisiblePwStr;
76 
77 
78 
79 private slots:
80  void pipVersion(const QString &version);
81  void outputReceived(const QString &text, bool success);
82  void pipRequestStarted(const PipManager::Task &task, const QString &text, bool outputSilent);
83  void pipRequestFinished(const PipManager::Task &task, const QString &text, bool success);
84  void on_btnReload_clicked();
85  void on_btnCheckForUpdates_clicked();
86  void on_btnInstall_clicked();
87  void on_btnUninstall_clicked();
88  void on_btnUpdate_clicked();
89  void on_btnSudoUninstall_clicked();
90  void on_btnVerifyInstalledPackages_clicked();
91  void treeViewSelectionChanged(const QItemSelection & selected, const QItemSelection & deselected);
92  void tableCustomContextMenuRequested(const QPoint &pos);
93  void exportTableToClipboard();
94  void exportTableToCsv();
95 };
96 
97 } //end namespace ito
98 
99 #endif
Definition: dialogPipManager.h:40
Definition: apiFunctionsGraph.cpp:39
Definition: pipManager.h:52
Definition: pipManager.h:83