Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
@@ -0,0 +1,30 @@
|
||||
#
|
||||
# $Id$
|
||||
# $HeadURL$
|
||||
# $Author$
|
||||
# Created by Mike Wille, SLSE, 2016-05-05
|
||||
#
|
||||
|
||||
SET(flm_combobox_gui_SRCS
|
||||
flm_combobox_gui_plugin.cpp
|
||||
flm_combobox_gui_plugin.h
|
||||
flm_combobox.cpp
|
||||
flm_combobox.h
|
||||
)
|
||||
|
||||
NGL_WRAP_UI(flm_combobox_gui_SRCS
|
||||
)
|
||||
|
||||
NGL_ADD_LIBRARY(WS FlmComboBoxGuiPlugin MODULE ${flm_combobox_gui_SRCS})
|
||||
NGL_TARGET_LINK_LIBRARIES(FlmComboBoxGuiPlugin
|
||||
NGLLogger
|
||||
FlmGuiComboboxPluginInterface
|
||||
FlmDataPluginInterface
|
||||
Qt5::Widgets
|
||||
LtsWidgets
|
||||
LtsSession
|
||||
)
|
||||
|
||||
NGL_INSTALL_TARGET(FlmComboBoxGuiPlugin)
|
||||
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* FileManagement - FlmComboBox Gui Plugin
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Iuliana Ojog, SLSE, 2017-05-29
|
||||
*/
|
||||
|
||||
#include "flm_combobox.h"
|
||||
#include <FileManagement/flm_translation.h>
|
||||
|
||||
namespace FileManagement
|
||||
{
|
||||
bool FlmComboBox::fill(LtsWidgets::LtsComboBox *cbx, FlmComboBoxType type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case FlmComboBoxType::CbFileCategory:
|
||||
{
|
||||
cbx->addItem(FileManagement::toString(FileManagement::FileCategory::Global), FileManagement::FileCategory::Global);
|
||||
cbx->addItem(FileManagement::toString(FileManagement::FileCategory::Exercise), FileManagement::FileCategory::Exercise);
|
||||
cbx->addItem(FileManagement::toString(FileManagement::FileCategory::User), FileManagement::FileCategory::User);
|
||||
break;
|
||||
}
|
||||
case FlmComboBoxType::CbFileStatus:
|
||||
{
|
||||
cbx->addItem(FileManagement::toString(FileManagement::FileStatus::Valid), FileManagement::FileStatus::Valid);
|
||||
cbx->addItem(FileManagement::toString(FileManagement::FileStatus::Deleted), FileManagement::FileStatus::Deleted);
|
||||
break;
|
||||
}
|
||||
case FlmComboBoxType::CbFileType:
|
||||
{
|
||||
cbx->addItem(FileManagement::toString(FileManagement::FileType::Unknown), FileManagement::FileType::Unknown);
|
||||
cbx->addItem(FileManagement::toString(FileManagement::FileType::Text), FileManagement::FileType::Text);
|
||||
cbx->addItem(FileManagement::toString(FileManagement::FileType::Xml), FileManagement::FileType::Xml);
|
||||
cbx->addItem(FileManagement::toString(FileManagement::FileType::Pdf), FileManagement::FileType::Pdf);
|
||||
cbx->addItem(FileManagement::toString(FileManagement::FileType::Jpg), FileManagement::FileType::Jpg);
|
||||
cbx->addItem(FileManagement::toString(FileManagement::FileType::Png), FileManagement::FileType::Png);
|
||||
cbx->addItem(FileManagement::toString(FileManagement::FileType::TacticalPlan), FileManagement::FileType::TacticalPlan);
|
||||
cbx->addItem(FileManagement::toString(FileManagement::FileType::OperatorFavourite), FileManagement::FileType::OperatorFavourite);
|
||||
cbx->addItem(FileManagement::toString(FileManagement::FileType::OperatorDefinedSymbol), FileManagement::FileType::OperatorDefinedSymbol);
|
||||
cbx->addItem(FileManagement::toString(FileManagement::FileType::OpenOfficeDocument), FileManagement::FileType::OpenOfficeDocument);
|
||||
cbx->addItem(FileManagement::toString(FileManagement::FileType::OpenOfficeSpreadsheet), FileManagement::FileType::OpenOfficeSpreadsheet);
|
||||
cbx->addItem(FileManagement::toString(FileManagement::FileType::OpenOfficePresentation), FileManagement::FileType::OpenOfficePresentation);
|
||||
cbx->addItem(FileManagement::toString(FileManagement::FileType::MSOfficeDocument), FileManagement::FileType::MSOfficeDocument);
|
||||
cbx->addItem(FileManagement::toString(FileManagement::FileType::MSOfficeDocument97), FileManagement::FileType::MSOfficeDocument97);
|
||||
cbx->addItem(FileManagement::toString(FileManagement::FileType::MSOfficeSpreadsheet), FileManagement::FileType::MSOfficeSpreadsheet);
|
||||
cbx->addItem(FileManagement::toString(FileManagement::FileType::MSOfficeSpreadsheet97), FileManagement::FileType::MSOfficeSpreadsheet97);
|
||||
cbx->addItem(FileManagement::toString(FileManagement::FileType::MSOfficePresentation), FileManagement::FileType::MSOfficePresentation);
|
||||
cbx->addItem(FileManagement::toString(FileManagement::FileType::MSOfficePresentation97), FileManagement::FileType::MSOfficePresentation97);
|
||||
cbx->addItem(FileManagement::toString(FileManagement::FileType::EvaluationSchema), FileManagement::FileType::EvaluationSchema);
|
||||
cbx->addItem(FileManagement::toString(FileManagement::FileType::AdlerJson), FileManagement::FileType::AdlerJson);
|
||||
break;
|
||||
}
|
||||
case FlmComboBoxType::CbUnknown:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return cbx->count() > 0;
|
||||
}
|
||||
|
||||
} // namespace FileManagement
|
||||
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* FileManagement - FlmComboBox Gui Plugin
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Iuliana Ojog, SLSE, 2017-05-29
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LtsWidgets/lts_combo_box.h>
|
||||
#include <FileManagement/logger.h>
|
||||
|
||||
namespace FileManagement
|
||||
{
|
||||
enum FlmComboBoxType
|
||||
{
|
||||
CbUnknown = 0,
|
||||
CbFileCategory,
|
||||
CbFileStatus,
|
||||
CbFileType
|
||||
};
|
||||
|
||||
// --------------------------------------------------------
|
||||
// ComboBox
|
||||
// --------------------------------------------------------
|
||||
class FlmComboBox
|
||||
{
|
||||
public:
|
||||
Q_REQUIRED_RESULT static bool fill(LtsWidgets::LtsComboBox *cbx,
|
||||
FlmComboBoxType type);
|
||||
};
|
||||
|
||||
} // namespace FileManagement
|
||||
@@ -0,0 +1,54 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* GUI Plugin for FileManagement - FlmComboBox
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Iuliana Ojog, SLSE, 2017-05-29
|
||||
*/
|
||||
|
||||
#include "flm_combobox_gui_plugin.h"
|
||||
|
||||
namespace FileManagement
|
||||
{
|
||||
std::shared_ptr<GuiPluginBase::Interface> GuiPlugin::createGuiInterface(LtsSession::LtsSession *session)
|
||||
{
|
||||
return std::make_shared<InterfaceImpl>(session);
|
||||
}
|
||||
|
||||
InterfaceImpl::InterfaceImpl(LtsSession::LtsSession *session)
|
||||
: GuiPluginBase::Interface(session, getLogger("Plugins.Gui.FlmCombobox"))
|
||||
{}
|
||||
|
||||
bool InterfaceImpl::fetchInterfaces()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void InterfaceImpl::clearInterfaces()
|
||||
{
|
||||
}
|
||||
|
||||
bool InterfaceImpl::fillFileCategoryComboBox(LtsWidgets::LtsComboBox *cbx)
|
||||
{
|
||||
return fillFlmComboBox(cbx, FlmComboBoxType::CbFileCategory);
|
||||
}
|
||||
|
||||
bool InterfaceImpl::fillFileStatusComboBox(LtsWidgets::LtsComboBox *cbx)
|
||||
{
|
||||
return fillFlmComboBox(cbx, FlmComboBoxType::CbFileStatus);
|
||||
}
|
||||
|
||||
bool InterfaceImpl::fillFileTypeComboBox(LtsWidgets::LtsComboBox *cbx)
|
||||
{
|
||||
return fillFlmComboBox(cbx, FlmComboBoxType::CbFileType);
|
||||
}
|
||||
|
||||
//private
|
||||
|
||||
bool InterfaceImpl::fillFlmComboBox(LtsWidgets::LtsComboBox *cbx, FlmComboBoxType type)
|
||||
{
|
||||
return FlmComboBox::fill(cbx, type);
|
||||
}
|
||||
|
||||
} // namespace FileManagement
|
||||
@@ -0,0 +1,67 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Gui Plugin for FileManagement - FlmComboBox
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Iuliana Ojog, SLSE, 2017-05-29
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "flm_combobox.h"
|
||||
|
||||
#include <LtsSession/lts_session.h>
|
||||
|
||||
#include <FileManagement/logger.h>
|
||||
|
||||
#include <PluginInterfaces/gui_plugin_interface.h>
|
||||
#include <Plugins/FileManagement/flm_combobox_gui_plugin_interface.h>
|
||||
#include <Plugins/FileManagement/flm_data_plugin_interface.h>
|
||||
|
||||
#include <QComboBox>
|
||||
|
||||
namespace FileManagement
|
||||
{
|
||||
|
||||
class GuiPlugin final : public QObject, public GuiPluginBase::Plugin
|
||||
{
|
||||
Q_PLUGIN_METADATA(IID "gui:3:flm.combobox")
|
||||
Q_INTERFACES(GuiPluginBase::Plugin)
|
||||
|
||||
Q_OBJECT
|
||||
public:
|
||||
GuiPlugin() = default;
|
||||
~GuiPlugin() = default;
|
||||
|
||||
QString pluginName() override { return QStringLiteral("FileManagement.GuiPlugin.ComboBox"); }
|
||||
std::shared_ptr<GuiPluginBase::Interface> createGuiInterface(LtsSession::LtsSession *session) override;
|
||||
bool availableInPartition(IDL::PartitionType partition) const override
|
||||
{
|
||||
return (partition == IDL::PartitionType::Global ||
|
||||
partition == IDL::PartitionType::Exercise ||
|
||||
partition == IDL::PartitionType::Replay);
|
||||
}
|
||||
};
|
||||
|
||||
class InterfaceImpl final : public QObject, public ForeignGuiComboboxInterface, public GuiPluginBase::Interface
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit InterfaceImpl(LtsSession::LtsSession *session);
|
||||
|
||||
bool fetchInterfaces() override;
|
||||
void clearInterfaces() override;
|
||||
QString menuGroup() const override { return QString(); }
|
||||
bool availableInPartition(IDL::PartitionType partition) const override { return partition == IDL::PartitionType::Global || partition == IDL::PartitionType::Exercise; }
|
||||
|
||||
// ForeignDataInterface
|
||||
bool fillFileCategoryComboBox(LtsWidgets::LtsComboBox *cbx) override;
|
||||
bool fillFileStatusComboBox(LtsWidgets::LtsComboBox *cbx) override;
|
||||
bool fillFileTypeComboBox(LtsWidgets::LtsComboBox *cbx) override;
|
||||
|
||||
private:
|
||||
bool fillFlmComboBox(LtsWidgets::LtsComboBox *cbx, FlmComboBoxType type);
|
||||
};
|
||||
|
||||
} // namespace FileManagement
|
||||
Reference in new issue
Block a user