refs #392 Added BlackGui::CPluginConfigWindow

* CPluginConfigWindow is now base class for all plugin config windows
* CPluginConfigWindow is styled properly
* Fixed behaviour in CSimulatorXPlaneConfigWindow
This commit is contained in:
Michał Garapich
2015-09-08 22:10:02 +02:00
committed by Mathew Sutcliffe
parent a0b4d47736
commit 06c17d7d09
11 changed files with 128 additions and 17 deletions

View File

@@ -4,6 +4,7 @@
#include "blackcore/context_simulator.h"
#include "blackcore/context_network.h"
#include "blackgui/pluginconfig.h"
#include "blackgui/pluginconfigwindow.h"
#include "blackgui/plugindetailswindow.h"
#include "blackmisc/simulation/simulatorplugininfolist.h"
#include "blackmisc/simulation/simulatedaircraftlist.h"
@@ -279,8 +280,8 @@ namespace BlackGui
QString configId = m_plugins->getPluginConfigId(selected->getIdentifier());
IPluginConfig *config = m_plugins->getPluginById<IPluginConfig>(configId);
QWidget *window = config->createConfigWindow();
// window->setParent(qApp->activeWindow());
CPluginConfigWindow *window = config->createConfigWindow();
window->setParent(qApp->activeWindow());
window->setWindowFlags(Qt::Dialog);
window->setAttribute(Qt::WA_DeleteOnClose);
window->show();

View File

@@ -5,14 +5,12 @@
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
* including this file, may be copied, modified, propagated, or distributed except according to the terms
* contained in the LICENSE file.
*
* Class based on qLed: Copyright (C) 2010 by P. Sereno, http://www.sereno-online.com
*/
//! \file
#ifndef BLACKGUI_PLUGINCONFIG_H
#define BCLAKGUI_PLUGINCONFIG_H
#define BLACKGUI_PLUGINCONFIG_H
#include "blackgui/blackguiexport.h"
#include <QtWidgets/QWidget>
@@ -20,13 +18,24 @@
namespace BlackGui
{
class CPluginConfigWindow;
/**
* The interface for the plugin config.
* The plugin config plugin is always called from the GUI process in order
* to make it possible to create a config window.
*
* \sa BlackCore::ISimulator.
*/
class BLACKGUI_EXPORT IPluginConfig
{
public:
//! Dtor.
virtual ~IPluginConfig() = default;
virtual QWidget *createConfigWindow() = 0;
//! Creates a new config window and returns its pointer.
virtual CPluginConfigWindow *createConfigWindow() = 0;
};
}

View File

@@ -0,0 +1,10 @@
#include "pluginconfigwindow.h"
namespace BlackGui {
CPluginConfigWindow::CPluginConfigWindow() : QWidget(nullptr)
{
}
}

View File

@@ -0,0 +1,30 @@
/* Copyright (C) 2015
* swift project Community / Contributors
*
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
* including this file, may be copied, modified, propagated, or distributed except according to the terms
* contained in the LICENSE file.
*/
//! \file
#ifndef BLACKGUI_PLUGINCONFIGWINDOW_H
#define BLACKGUI_PLUGINCONFIGWINDOW_H
#include "blackgui/blackguiexport.h"
#include <QWidget>
namespace BlackGui
{
class BLACKGUI_EXPORT CPluginConfigWindow : public QWidget
{
Q_OBJECT
public:
//! No parent
explicit CPluginConfigWindow();
};
}
#endif // CPLUGINCONFIGWINDOW_H

View File

@@ -111,9 +111,9 @@ BlackGui--Editors--CValidationIndicator {
background-image: url(:/textures/icons/textures/texture-inner.jpg);
}
BlackGui--CPluginDetailsWindow {
background-image: url(:/textures/icons/textures/texture-inner.jpg);
background-color: darkslategray;
BlackGui--CPluginDetailsWindow,
BlackGui--CPluginConfigWindow {
background: black;
}
/** default for buttons **/