itom  3.0.0
dialogPipManager.h
1 /* ********************************************************************
2  itom software
3  URL: http://www.uni-stuttgart.de/ito
4  Copyright (C) 2016, 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();
62 
63 private:
64  PipManager *m_pPipManager;
65  Ui::DialogPipManager ui;
66  QString logHtml;
67  PipManager::Task m_currentTask;
68  int m_lastLogEntry; //-1: nothing yet, 0: standard text, 1: error text
69  bool m_outputSilent;
70  bool m_standalone;
71  QColor m_colorMessage;
72  QColor m_colorError;
73 
74 private slots:
75  void pipVersion(const QString &version);
76  void outputReceived(const QString &text, bool success);
77  void pipRequestStarted(const PipManager::Task &task, const QString &text, bool outputSilent);
78  void pipRequestFinished(const PipManager::Task &task, const QString &text, bool success);
79  void on_btnReload_clicked();
80  void on_btnCheckForUpdates_clicked();
81  void on_btnInstall_clicked();
82  void on_btnUninstall_clicked();
83  void on_btnUpdate_clicked();
84  void on_btnSudoUninstall_clicked();
85  void treeViewSelectionChanged(const QItemSelection & selected, const QItemSelection & deselected);
86 };
87 
88 } //end namespace ito
89 
90 #endif
Definition: dialogPipManager.h:40
Definition: apiFunctionsGraph.cpp:39
Definition: pipManager.h:52
Definition: pipManager.h:74