Moved files out of gsmartcontrol directory after import from SVN.

This commit is contained in:
Alexander Shaduri
2021-02-23 20:24:01 +04:00
parent 7075a4f4d5
commit 0f6ff2a4cb
226 changed files with 0 additions and 0 deletions
+67
View File
@@ -0,0 +1,67 @@
/**************************************************************************
Copyright:
(C) 2011 - 2018 Alexander Shaduri <ashaduri 'at' gmail.com>
License: See LICENSE_gsmartcontrol.txt
***************************************************************************/
/// \file
/// \author Alexander Shaduri
/// \ingroup applib
/// \weakgroup applib
/// @{
#include "hz/debug.h"
#include "executor_factory.h"
#include "smartctl_executor_gui.h"
#include "cli_executors.h"
ExecutorFactory::ExecutorFactory(bool use_gui, Gtk::Window* parent)
: use_gui_(use_gui), parent_(parent)
{ }
std::shared_ptr<CmdexSync> ExecutorFactory::create_executor(ExecutorFactory::ExecutorType type)
{
switch (type) {
case ExecutorType::Smartctl:
{
if (use_gui_) {
auto ex = std::make_shared<SmartctlExecutorGui>();
ex->create_running_dialog(parent_); // dialog parent
return ex;
}
return std::make_shared<SmartctlExecutor>();
}
case ExecutorType::TwCli:
{
if (use_gui_) {
auto ex = std::make_shared<TwCliExecutorGui>();
ex->create_running_dialog(parent_); // dialog parent
return ex;
}
return std::make_shared<TwCliExecutor>();
}
case ExecutorType::ArecaCli:
{
if (use_gui_) {
auto ex = std::make_shared<ArecaCliExecutorGui>();
ex->create_running_dialog(parent_); // dialog parent
return ex;
}
return std::make_shared<ArecaCliExecutor>();
}
}
DBG_ASSERT(0);
return std::make_shared<CmdexSync>();
}
/// @}