summaryrefslogtreecommitdiff
path: root/LanguagesManager.h
diff options
context:
space:
mode:
Diffstat (limited to 'LanguagesManager.h')
-rw-r--r--LanguagesManager.h101
1 files changed, 48 insertions, 53 deletions
diff --git a/LanguagesManager.h b/LanguagesManager.h
index a517cac..8ec893d 100644
--- a/LanguagesManager.h
+++ b/LanguagesManager.h
@@ -1,9 +1,7 @@
/** \file LanguagesManager.h
\brief Define the class to manage and load the languages
\author alpha_one_x86
-\version 0.3
-\date 2010
-\licence GPL3, see the file COPYING */
+\licence GPL3, see the file COPYING */
#ifndef LANGUAGES_MANAGER_H
#define LANGUAGES_MANAGER_H
@@ -19,7 +17,6 @@
#include <QDir>
#include "Environment.h"
-#include "Singleton.h"
#include "OptionEngine.h"
#include "ResourcesManager.h"
#include "PluginsManager.h"
@@ -27,56 +24,54 @@
/** \brief Define the class to manage and load the resources linked with the themes
This class provide a core load and manage the resources */
-class LanguagesManager : public QObject, public Singleton<LanguagesManager>
+class LanguagesManager : public QObject
{
- Q_OBJECT
- friend class Singleton<LanguagesManager>;
- //public:
- // QString getMainShortName();
- private:
- /// \brief Create the manager and load the defaults variables
- LanguagesManager();
- /// \brief Destroy the language manager
- ~LanguagesManager();
- //for the options
- OptionEngine *options;
- /** \brief To set the current language
- \param newLanguage Should be short name code found into informations.xml of language file */
- void setCurrentLanguage(const QString &newLanguage);
- /// \brief Structure of language
- struct LanguagesAvailable
- {
- QString path;
- QString fullName;
- QString mainShortName;
- QStringList shortName;
- };
- /// \brief To store the language path
- QStringList languagePath;
- /// \brief To store the language detected
- QList<LanguagesAvailable> LanguagesAvailableList;
- /// \brief check if short name is found into language
- QString getMainShortName(const QString &shortName);
- /// \brief Store the object of resources manager
- ResourcesManager *resources;
- /// \brief Store the object of plugin manager
- PluginsManager *plugins;
- /// \brief list of installed translator
- QList<QTranslator *> installedTranslator;
- QString currentLanguage;
- /// \brief load the language selected
- QString getTheRightLanguage();
- private slots:
- /// \brief load the language in languagePath
- void allPluginIsLoaded();
- //plugin management
- void onePluginAdded(const PluginsAvailable &plugin);
- void onePluginWillBeRemoved(const PluginsAvailable &plugin);
- void newOptionValue(const QString &group);
- signals:
- //send the language is loaded or the new language is loaded
- void newLanguageLoaded(const QString &mainShortName);
- void previouslyPluginAdded(PluginsAvailable);
+ Q_OBJECT
+ //public:
+ // QString getMainShortName();
+ public:
+ const QString autodetectedLanguage() const;
+ static LanguagesManager *languagesManager;
+ /// \brief Create the manager and load the defaults variables
+ LanguagesManager();
+ /// \brief Destroy the language manager
+ ~LanguagesManager();
+ private:
+ /** \brief To set the current language
+ \param newLanguage Should be short name code found into informations.xml of language file */
+ void setCurrentLanguage(const QString &newLanguage);
+ /// \brief Structure of language
+ struct LanguagesAvailable
+ {
+ QString path;
+ QString fullName;
+ QString mainShortName;
+ QStringList shortName;
+ };
+ /// \brief To store the language path
+ QStringList languagePath;
+ /// \brief To store the language detected
+ QList<LanguagesAvailable> LanguagesAvailableList;
+ /// \brief check if short name is found into language
+ QString getMainShortName(const QString &shortName) const;
+ /// \brief list of installed translator
+ QList<QTranslator *> installedTranslator;
+ QString currentLanguage;
+ /// \brief load the language selected
+ QString getTheRightLanguage() const;
+ private slots:
+ /// \brief load the language in languagePath
+ void allPluginIsLoaded();
+ //plugin management
+ void onePluginAdded(const PluginsAvailable &plugin);
+ #ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE
+ void onePluginWillBeRemoved(const PluginsAvailable &plugin);
+ #endif
+ void newOptionValue(const QString &group);
+ signals:
+ //send the language is loaded or the new language is loaded
+ void newLanguageLoaded(const QString &mainShortName) const;
+ void previouslyPluginAdded(PluginsAvailable) const;
};
#endif // LANGUAGES_MANAGER_H