itom 2.2.1
|
00001 /* ******************************************************************** 00002 itom software 00003 URL: http://www.uni-stuttgart.de/ito 00004 Copyright (C) 2016, Institut fuer Technische Optik (ITO), 00005 Universitaet Stuttgart, Germany 00006 00007 This file is part of itom. 00008 00009 itom is free software; you can redistribute it and/or modify it 00010 under the terms of the GNU Library General Public Licence as published by 00011 the Free Software Foundation; either version 2 of the Licence, or (at 00012 your option) any later version. 00013 00014 itom is distributed in the hope that it will be useful, but 00015 WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library 00017 General Public Licence for more details. 00018 00019 You should have received a copy of the GNU Library General Public License 00020 along with itom. If not, see <http://www.gnu.org/licenses/>. 00021 *********************************************************************** */ 00022 00023 #ifndef DIALOGPIPMANAGER_H 00024 #define DIALOGPIPMANAGER_H 00025 00026 #include "../../common/addInInterface.h" 00027 #include "../../common/sharedStructures.h" 00028 00029 #include "../models/pipManager.h" 00030 00031 #include <qdialog.h> 00032 #include <qvector.h> 00033 #include <qevent.h> 00034 #include <qcolor.h> 00035 00036 #include "ui_dialogPipManager.h" 00037 00038 namespace ito { 00039 00040 class DialogPipManager : public QDialog 00041 { 00042 Q_OBJECT 00043 00044 Q_PROPERTY(QColor colorMessage READ colorMessage WRITE setColorMessage DESIGNABLE true); 00045 Q_PROPERTY(QColor colorError READ colorError WRITE setColorError DESIGNABLE true); 00046 00047 public: 00048 DialogPipManager(QWidget *parent = NULL, bool standalone = false); 00049 ~DialogPipManager(); 00050 00051 QColor colorMessage() { return m_colorMessage; } 00052 void setColorMessage(const QColor &color); 00053 00054 QColor colorError() { return m_colorError; } 00055 void setColorError(const QColor &color); 00056 00057 protected: 00058 void closeEvent(QCloseEvent *e); 00059 PipGeneralOptions createOptions() const; 00060 00061 void installOrUpdatePackage(); 00062 00063 private: 00064 PipManager *m_pPipManager; 00065 Ui::DialogPipManager ui; 00066 QString logHtml; 00067 PipManager::Task m_currentTask; 00068 int m_lastLogEntry; //-1: nothing yet, 0: standard text, 1: error text 00069 bool m_outputSilent; 00070 bool m_standalone; 00071 QColor m_colorMessage; 00072 QColor m_colorError; 00073 00074 private slots: 00075 void pipVersion(const QString &version); 00076 void outputReceived(const QString &text, bool success); 00077 void pipRequestStarted(const PipManager::Task &task, const QString &text, bool outputSilent); 00078 void pipRequestFinished(const PipManager::Task &task, const QString &text, bool success); 00079 void on_btnReload_clicked(); 00080 void on_btnCheckForUpdates_clicked(); 00081 void on_btnInstall_clicked(); 00082 void on_btnUninstall_clicked(); 00083 void on_btnUpdate_clicked(); 00084 void on_btnSudoUninstall_clicked(); 00085 void treeViewSelectionChanged(const QItemSelection & selected, const QItemSelection & deselected); 00086 }; 00087 00088 } //end namespace ito 00089 00090 #endif