dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
pluginerrorview.cpp
Go to the documentation of this file.
1 
13 /*
14  * This program is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation; either version 3 of the License, or
17  * (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful, but
20  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  * for more details.
23  *
24  * You should have received a copy of the GNU General Public License along
25  * with this program; if not, see <http://www.gnu.org/licenses/>
26  */
27 
28 #include "pluginerrorview.h"
29 #include "ui_pluginerrorview.h"
30 #include "pluginspec.h"
31 
32 #include <QtCore/QString>
33 
44 using namespace ExtensionSystem;
45 
51  : QWidget(parent),
52  m_ui(new Internal::Ui::PluginErrorView())
53 {
54  m_ui->setupUi(this);
55 }
56 
62 {
63  delete m_ui;
64 }
65 
72 {
73  QString text;
74  QString tooltip;
75  switch (spec->state()) {
77  text = tr("Invalid");
78  tooltip = tr("Description file found, but error on read");
79  break;
80  case PluginSpec::Read:
81  text = tr("Read");
82  tooltip = tr("Description successfully read");
83  break;
85  text = tr("Resolved");
86  tooltip = tr("Dependencies are successfully resolved");
87  break;
88  case PluginSpec::Loaded:
89  text = tr("Loaded");
90  tooltip = tr("Library is loaded");
91  break;
93  text = tr("Initialized");
94  tooltip = tr("Plugin's initialization method succeeded");
95  break;
97  text = tr("Running");
98  tooltip = tr("Plugin successfully loaded and running");
99  break;
100  case PluginSpec::Stopped:
101  text = tr("Stopped");
102  tooltip = tr("Plugin was shut down");
103  break;
104  case PluginSpec::Deleted:
105  text = tr("Deleted");
106  tooltip = tr("Plugin ended its life cycle and was deleted");
107  break;
108  }
109  m_ui->state->setText(text);
110  m_ui->state->setToolTip(tooltip);
111  m_ui->errorString->setText(spec->errorString());
112 }
QString errorString() const
Definition: pluginspec.cpp:319
Contains the information of the plugins xml description file and information about the plugin's curre...
Definition: pluginspec.h:63
PluginErrorView(QWidget *parent=nullptr)
Widget that displays the state and error message of a PluginSpec.