LP-311 Remove basic/advanced stabilization tab auto-switch (autotune/txpid lock issues)
[librepilot.git] / ground / gcs / src / libs / extensionsystem / plugindetailsview.cpp
blobaad82582dcc50a977ca78e8ef98bc4ca7a8ee2d3
1 /**
2 ******************************************************************************
4 * @file plugindetailsview.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.
7 * @brief
8 * @see The GNU Public License (GPL) Version 3
9 * @defgroup
10 * @{
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
22 * for more details.
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 "plugindetailsview.h"
30 #include "ui_plugindetailsview.h"
31 #include "pluginspec.h"
33 #include <QtCore/QDir>
35 /*!
36 \class ExtensionSystem::PluginDetailsView
37 \brief Widget that displays the contents 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;
47 /*!
48 \fn PluginDetailsView::PluginDetailsView(QWidget *parent)
49 Constructs a new view with given \a parent widget.
51 PluginDetailsView::PluginDetailsView(QWidget *parent)
52 : QWidget(parent),
53 m_ui(new Internal::Ui::PluginDetailsView())
55 m_ui->setupUi(this);
58 /*!
59 \fn PluginDetailsView::~PluginDetailsView()
60 \internal
62 PluginDetailsView::~PluginDetailsView()
64 delete m_ui;
67 /*!
68 \fn void PluginDetailsView::update(PluginSpec *spec)
69 Reads the given \a spec and displays its values
70 in this PluginDetailsView.
72 void PluginDetailsView::update(PluginSpec *spec)
74 m_ui->name->setText(spec->name());
75 m_ui->version->setText(spec->version());
76 m_ui->compatVersion->setText(spec->compatVersion());
77 m_ui->vendor->setText(spec->vendor());
78 const QString link = QString::fromLatin1("<a href=\"%1\">%1</a>").arg(spec->url());
79 m_ui->url->setText(link);
80 m_ui->location->setText(QDir::toNativeSeparators(spec->filePath()));
81 m_ui->description->setText(spec->description());
82 m_ui->copyright->setText(spec->copyright());
83 m_ui->license->setText(spec->license());
84 QStringList depStrings;
85 foreach(PluginDependency dep, spec->dependencies()) {
86 depStrings << QString("%1 (%2)").arg(dep.name).arg(dep.version);
88 m_ui->dependencies->addItems(depStrings);