2 ******************************************************************************
4 * @file pluginerrorview.cpp
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
6 * Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009.
8 * @see The GNU Public License (GPL) Version 3
12 *****************************************************************************/
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.
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
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, write to the Free Software Foundation, Inc.,
26 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 #include "pluginerrorview.h"
30 #include "ui_pluginerrorview.h"
31 #include "pluginspec.h"
33 #include <QtCore/QString>
36 \class ExtensionSystem::PluginErrorView
37 \brief Widget that displays the state and error message of a PluginSpec.
39 Can be used for integration in the application that
40 uses the plugin manager.
42 \sa ExtensionSystem::PluginView
45 using namespace ExtensionSystem
;
48 \fn PluginErrorView::PluginErrorView(QWidget *parent)
49 Constructs a new error view with given \a parent widget.
51 PluginErrorView::PluginErrorView(QWidget
*parent
)
53 m_ui(new Internal::Ui::PluginErrorView())
59 \fn PluginErrorView::~PluginErrorView()
62 PluginErrorView::~PluginErrorView()
68 \fn void PluginErrorView::update(PluginSpec *spec)
69 Reads the given \a spec and displays its state and
70 error information in this PluginErrorView.
72 void PluginErrorView::update(PluginSpec
*spec
)
77 switch (spec
->state()) {
78 case PluginSpec::Invalid
:
80 tooltip
= tr("Description file found, but error on read");
82 case PluginSpec::Read
:
84 tooltip
= tr("Description successfully read");
86 case PluginSpec::Resolved
:
87 text
= tr("Resolved");
88 tooltip
= tr("Dependencies are successfully resolved");
90 case PluginSpec::Loaded
:
92 tooltip
= tr("Library is loaded");
94 case PluginSpec::Initialized
:
95 text
= tr("Initialized");
96 tooltip
= tr("Plugin's initialization method succeeded");
98 case PluginSpec::Running
:
100 tooltip
= tr("Plugin successfully loaded and running");
102 case PluginSpec::Stopped
:
103 text
= tr("Stopped");
104 tooltip
= tr("Plugin was shut down");
105 case PluginSpec::Deleted
:
106 text
= tr("Deleted");
107 tooltip
= tr("Plugin ended its life cycle and was deleted");
109 m_ui
->state
->setText(text
);
110 m_ui
->state
->setToolTip(tooltip
);
111 m_ui
->errorString
->setText(spec
->errorString());