File: pluginsdialog.cpp

package info (click to toggle)
sdrangelove 0.0.1.20140824-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,560 kB
  • ctags: 2,668
  • sloc: cpp: 17,760; ansic: 142; makefile: 17; sh: 1
file content (42 lines) | stat: -rw-r--r-- 1,333 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include "gui/pluginsdialog.h"
#include "mainwindow.h"
#include "ui_pluginsdialog.h"

PluginsDialog::PluginsDialog(PluginManager* pluginManager, QWidget* parent) :
	QDialog(parent),
	ui(new Ui::PluginsDialog)
{
	ui->setupUi(this);

	const PluginManager::Plugins& plugins = pluginManager->getPlugins();
	for(PluginManager::Plugins::const_iterator it = plugins.constBegin(); it != plugins.constEnd(); ++it) {
		QStringList sl;
		const PluginDescriptor& desc = it->plugin->getPluginDescriptor();
		sl.append(desc.displayedName);
		sl.append(desc.version);
		if(desc.licenseIsGPL)
			sl.append(tr("YES"));
		else sl.append("no");
		QTreeWidgetItem* pluginItem = new QTreeWidgetItem(ui->tree, sl);
		sl.clear();
		sl.append(tr("Copyright: %1").arg(desc.copyright));
		QTreeWidgetItem* item = new QTreeWidgetItem(pluginItem, sl);
		item->setFirstColumnSpanned(true);
		sl.clear();
		sl.append(tr("Website: %1").arg(desc.website));
		item = new QTreeWidgetItem(pluginItem, sl);
		item->setFirstColumnSpanned(true);
		sl.clear();
		sl.append(tr("Source Code: %1").arg(desc.sourceCodeURL));
		item = new QTreeWidgetItem(pluginItem, sl);
		item->setFirstColumnSpanned(true);
	}
	ui->tree->resizeColumnToContents(0);
	ui->tree->resizeColumnToContents(1);
	ui->tree->resizeColumnToContents(2);
}

PluginsDialog::~PluginsDialog()
{
	delete ui;
}