| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| |
|
| | #ifndef RS_SYSTEM_H |
| | #define RS_SYSTEM_H |
| |
|
| |
|
| | #define RS_SYSTEM RS_System::instance() |
| | #include <QList> |
| | #include <QSharedPointer> |
| |
|
| | class RS_Locale; |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | class RS_System { |
| |
|
| | public: |
| | |
| | |
| | |
| | static RS_System *instance(); |
| |
|
| | void init(const QString& appName, |
| | const QString& appVersion, |
| | const QString& appDirName, |
| | const char *arg0); |
| |
|
| | void init(const QString& appName, |
| | const QString& appVersion, |
| | const QString& appDirName, |
| | const QString& arg0); |
| | void initLanguageList(); |
| | void initAllLanguagesList(); |
| |
|
| | bool checkInit() const; |
| | bool createPaths(const QString& p); |
| |
|
| | |
| | |
| | |
| | static QString getHomeDir(); |
| | |
| | |
| | |
| | static QString getTempDir(); |
| | |
| | |
| | |
| | static QString getCurrentDir(); |
| |
|
| | |
| | |
| | |
| | QString getAppDataDir() const; |
| |
|
| | |
| | |
| | |
| | QStringList getFontList() const |
| | { |
| | QStringList ret = getFileList("fonts", "cxf"); |
| | return ret; |
| | } |
| |
|
| | |
| | |
| | |
| | QStringList getNewFontList() { |
| | QStringList ret = getFileList("fonts", "lff"); |
| | return ret; |
| | } |
| |
|
| | |
| | |
| | |
| | QStringList getPatternList() { |
| | QStringList ret = getFileList("patterns", "dxf"); |
| | return ret; |
| | } |
| |
|
| | |
| | |
| | |
| | QStringList getScriptList() { |
| | QStringList ret = getFileList("scripts/qsa", "qs"); |
| | return ret; |
| | } |
| |
|
| | |
| | |
| | |
| | QStringList getMachineList() { |
| | QStringList ret = getFileList("machines", "cxm"); |
| | return ret; |
| | } |
| |
|
| | |
| | |
| | |
| | QString getDocPath() { |
| | QStringList lst = getDirectoryList("doc"); |
| |
|
| | if( !lst.isEmpty()) { |
| | return lst.first(); |
| | } |
| | else { |
| | return QString(); |
| | } |
| | } |
| |
|
| | |
| | |
| | |
| | QString getAppName() const { |
| | return appName; |
| | } |
| |
|
| | |
| | |
| | |
| | QString getAppVersion() const { |
| | return appVersion; |
| | } |
| |
|
| | QStringList getFileList (const QString& subDirectory, |
| | const QString& fileExtension) const; |
| |
|
| | QStringList getDirectoryList(const QString& |
| | subDirectory) const; |
| |
|
| | QStringList getLanguageList() const { |
| | return languageList; |
| | } |
| |
|
| | static QString languageToSymbol(const QString& lang); |
| | static QString symbolToLanguage(const QString& symb); |
| |
|
| | static QString getEncoding(const QString& str); |
| |
|
| | void loadTranslation(const QString& lang, const QString& langCmd); |
| |
|
| | static bool test(); |
| |
|
| | |
| | |
| | |
| | static QByteArray localeToISO(const QByteArray& locale); |
| |
|
| | private: |
| | RS_System() = default; |
| | void addLocale(RS_Locale *locale); |
| | protected: |
| | QString appName; |
| | QString appVersion; |
| | QString appDirName; |
| | QString appDir; |
| |
|
| | QStringList languageList; |
| | bool initialized {false}; |
| | bool externalAppDir {false}; |
| | QList<QSharedPointer<RS_Locale>> allKnownLocales; |
| | }; |
| |
|
| | #endif |
| |
|