summaryrefslogtreecommitdiff
path: root/plugins-alternative/Themes/Windows/factory.cpp
diff options
context:
space:
mode:
authorThomas Preud'homme <robotux@celest.fr>2017-11-24 23:24:09 +0000
committerThomas Preud'homme <robotux@celest.fr>2017-11-24 23:24:09 +0000
commitb3c8bdcc0d1e4b2ab298847a7902b6d60410a5bc (patch)
tree8fce8a51adfb245db8ab2a76831661780c0c713e /plugins-alternative/Themes/Windows/factory.cpp
parente297dbd8052ef4e66f069e2dd1865ae7fa8af28e (diff)
New upstream version 1.2.3.6
Diffstat (limited to 'plugins-alternative/Themes/Windows/factory.cpp')
-rw-r--r--plugins-alternative/Themes/Windows/factory.cpp74
1 files changed, 74 insertions, 0 deletions
diff --git a/plugins-alternative/Themes/Windows/factory.cpp b/plugins-alternative/Themes/Windows/factory.cpp
new file mode 100644
index 0000000..dbce51a
--- /dev/null
+++ b/plugins-alternative/Themes/Windows/factory.cpp
@@ -0,0 +1,74 @@
+/** \file factory.cpp
+\brief Define the factory core
+\author alpha_one_x86
+*/
+
+#include "factory.h"
+
+QRegularExpression ThemesFactory::slashEnd;
+QRegularExpression ThemesFactory::isolateName;
+
+ThemesFactory::ThemesFactory()
+{
+ slashEnd=QRegularExpression("/$");
+ isolateName=QRegularExpression("^.*/([^/]+)$");
+}
+
+PluginInterface_Themes * ThemesFactory::getInstance()
+{
+ Themes * newInterface=new Themes(facilityEngine);
+ connect(this,&ThemesFactory::reloadLanguage,newInterface,&Themes::newLanguageLoaded);
+ return newInterface;
+}
+
+void ThemesFactory::setResources(OptionInterface * options,const QString &writePath,const QString &pluginPath,FacilityInterface * facilityEngine,const bool &portableVersion)
+{
+ Q_UNUSED(options)
+ Q_UNUSED(writePath)
+ Q_UNUSED(pluginPath)
+ this->facilityEngine=facilityEngine;
+ Q_UNUSED(portableVersion)
+}
+
+QWidget * ThemesFactory::options()
+{
+ return NULL;
+}
+
+QIcon ThemesFactory::getIcon(const QString &fileName) const
+{
+ if(fileName=="SystemTrayIcon/exit.png")
+ {
+ QIcon tempIcon=QIcon::fromTheme("application-exit");
+ if(!tempIcon.isNull())
+ return tempIcon;
+ }
+ if(fileName=="SystemTrayIcon/add.png")
+ {
+ QIcon tempIcon=QIcon::fromTheme("list-add");
+ if(!tempIcon.isNull())
+ return tempIcon;
+ }
+ if(fileName=="SystemTrayIcon/informations.png")
+ {
+ QIcon tempIcon=QIcon::fromTheme("help-about");
+ if(!tempIcon.isNull())
+ return tempIcon;
+ }
+ if(fileName=="SystemTrayIcon/options.png")
+ {
+ QIcon tempIcon=QIcon::fromTheme("applications-system");
+ if(!tempIcon.isNull())
+ return tempIcon;
+ }
+ return QIcon(":/Themes/Windows/resources/"+fileName);
+}
+
+void ThemesFactory::resetOptions()
+{
+}
+
+void ThemesFactory::newLanguageLoaded()
+{
+ emit reloadLanguage();
+}