makes translation reload automatically
More...
#include <dcpretranslator.h>
List of all members.
Detailed Description
makes translation reload automatically
MApplication's localeSettingsChanged signal should be connected on the retranslate slot, which loads the new translation. Also handles loading applet translations, they just should have the filename "duicontrolpanel-<appletname>.qm"
Widgets have to define their retranslateUi() virtual function properly, so that changes (new translations) could be shown immediately.
Constructor & Destructor Documentation
DcpRetranslator::~DcpRetranslator |
( |
|
) |
|
DcpRetranslator::DcpRetranslator |
( |
|
) |
[protected] |
Member Function Documentation
void DcpRetranslator::destroy |
( |
void |
|
) |
[static] |
Destroys the instance if any.
void DcpRetranslator::ensureTranslationsAreLoaded |
( |
const QStringList & |
catalogs |
) |
|
bool DcpRetranslator::eventFilter |
( |
QObject * |
obj, |
|
|
QEvent * |
event | |
|
) |
| | [protected] |
Filters out unnecessery LanguageChange events
If installed on a QApplication it will filter out all LanguageChange events which are not intentional in the sence that they are not caused by the retranslateUi. This can cause problems of course, so dont use it ;)
The retranslator is in compatibility mode if you call it with its constructor, so as not to cause problems with suw or other program, which are also using the retranslator. In compatibility mode retranslator behaves like before: it reloads the translations for all applets, which are in the db.
If you call it trough instance() it will not be in compatibility mode, which means it only reloads the translations for the active plugins, see DcpAppletMetadata::isActive(), and apps have to call ensureLoaded functions to load the translations for the actives.
bool DcpRetranslator::loadAppletTranslation |
( |
MLocale & |
locale, |
|
|
const DcpAppletMetadata * |
metadata | |
|
) |
| | [protected] |
Loads the translation for the applet into locale.
- Returns:
- true if the locale was modified, false otherwise.
Note that false return value does not indicate an error, it is also possible that the translation was already loaded, so no modification was necessery.
bool DcpRetranslator::loadTranslations |
( |
MLocale & |
locale, |
|
|
const QStringList & |
catalogList | |
|
) |
| | [protected] |
void DcpRetranslator::retranslate |
( |
|
) |
[slot] |
void DcpRetranslator::setMainCatalogName |
( |
const QString & |
catalogName |
) |
|
Friends And Related Function Documentation
friend class Ut_DcpRetranslator [friend] |
Member Data Documentation
The documentation for this class was generated from the following files: