| 
									
										
										
										
											2023-11-19 13:31:45 +01:00
										 |  |  | ///////////////////////////////////////////////////////////////////////////////////////
 | 
					
						
							|  |  |  | // Copyright (C) 2012 maintech GmbH, Otto-Hahn-Str. 15, 97204 Hoechberg, Germany     //
 | 
					
						
							|  |  |  | // written by Christian Daniel                                                       //
 | 
					
						
							|  |  |  | // Copyright (C) 2015, 2017, 2019 Edouard Griffiths, F4EXB <f4exb06@gmail.com>       //
 | 
					
						
							|  |  |  | //                                                                                   //
 | 
					
						
							|  |  |  | // This program is free software; you can redistribute it and/or modify              //
 | 
					
						
							|  |  |  | // it under the terms of the GNU General Public License as published by              //
 | 
					
						
							|  |  |  | // the Free Software Foundation as version 3 of the License, or                      //
 | 
					
						
							|  |  |  | // (at your option) any later version.                                               //
 | 
					
						
							|  |  |  | //                                                                                   //
 | 
					
						
							|  |  |  | // This program is distributed in the hope that it will be useful,                   //
 | 
					
						
							|  |  |  | // but WITHOUT ANY WARRANTY; without even the implied warranty of                    //
 | 
					
						
							|  |  |  | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the                      //
 | 
					
						
							|  |  |  | // GNU General Public License V3 for more details.                                   //
 | 
					
						
							|  |  |  | //                                                                                   //
 | 
					
						
							|  |  |  | // You should have received a copy of the GNU General Public License                 //
 | 
					
						
							|  |  |  | // along with this program. If not, see <http://www.gnu.org/licenses/>.              //
 | 
					
						
							|  |  |  | ///////////////////////////////////////////////////////////////////////////////////////
 | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | #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(); | 
					
						
							| 
									
										
										
										
											2019-12-16 01:03:47 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     for (PluginManager::Plugins::const_iterator it = plugins.constBegin(); it != plugins.constEnd(); ++it) | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 		QStringList sl; | 
					
						
							| 
									
										
										
										
											2015-09-30 08:55:58 +02:00
										 |  |  | 		const PluginDescriptor& desc = it->pluginInterface->getPluginDescriptor(); | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 		sl.append(desc.displayedName); | 
					
						
							|  |  |  | 		sl.append(desc.version); | 
					
						
							| 
									
										
										
										
											2019-12-16 01:03:47 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |         if (desc.licenseIsGPL) { | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 			sl.append(tr("YES")); | 
					
						
							| 
									
										
										
										
											2019-12-16 01:03:47 +01:00
										 |  |  |         } else { | 
					
						
							|  |  |  |             sl.append("no"); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 		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); | 
					
						
							| 
									
										
										
										
											2019-12-16 01:03:47 +01:00
										 |  |  |         sl.clear(); | 
					
						
							|  |  |  |         sl.append(tr("Hardware ID: %1").arg(desc.hardwareId)); | 
					
						
							|  |  |  | 		item = new QTreeWidgetItem(pluginItem, sl); | 
					
						
							|  |  |  | 		item->setFirstColumnSpanned(true); | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2019-12-16 01:03:47 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     ui->tree->resizeColumnToContents(0); | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 	ui->tree->resizeColumnToContents(1); | 
					
						
							|  |  |  | 	ui->tree->resizeColumnToContents(2); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | PluginsDialog::~PluginsDialog() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	delete ui; | 
					
						
							|  |  |  | } |