From 2736ad6e092c5d36561fac4ef318382cb0685614 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Tue, 4 Oct 2016 15:32:10 +0200 Subject: [PATCH] User-visible Type and Interface strings in Module. --- src/libcalamaresui/modulesystem/Module.cpp | 32 ++++++++++++++++++++++ src/libcalamaresui/modulesystem/Module.h | 2 ++ 2 files changed, 34 insertions(+) diff --git a/src/libcalamaresui/modulesystem/Module.cpp b/src/libcalamaresui/modulesystem/Module.cpp index ff0d3ef8d..5395ff7f2 100644 --- a/src/libcalamaresui/modulesystem/Module.cpp +++ b/src/libcalamaresui/modulesystem/Module.cpp @@ -228,6 +228,38 @@ Module::location() const } +QString +Module::typeString() const +{ + switch ( type() ) + { + case Job: + return "Job Module"; + case View: + return "View Module"; + } + return QString(); +} + + +QString +Module::interfaceString() const +{ + switch ( interface() ) + { + case ProcessInterface: + return "External process"; + case PythonInterface: + return "Python (Boost.Python)"; + case PythonQtInterface: + return "Python (experimental)"; + case QtPluginInterface: + return "Qt Plugin"; + } + return QString(); +} + + bool Module::isLoaded() const { diff --git a/src/libcalamaresui/modulesystem/Module.h b/src/libcalamaresui/modulesystem/Module.h index 171458f93..6934a554e 100644 --- a/src/libcalamaresui/modulesystem/Module.h +++ b/src/libcalamaresui/modulesystem/Module.h @@ -66,7 +66,9 @@ public: virtual QStringList requiredModules() const; virtual QString location() const final; virtual Type type() const = 0; + virtual QString typeString() const; virtual Interface interface() const = 0; + virtual QString interfaceString() const; virtual bool isLoaded() const;