Exemplo n.º 1
0
void ScribusQApp::initLang()
{
	QStringList langs = getLang(QString(lang));

	if (!langs.isEmpty())
		installTranslators(langs);
}
Exemplo n.º 2
0
/**
 * \brief Load a OPluginItem for the specified interface
 * This will open the resource of the OPluginItem::path() and then will query
 * if the Interface specified in the uuid is available and then will manage the
 * resource and Interface.
 *
 * @param item The OPluginItem that should be loaded
 * @param uuid The Interface to query for
 *
 * @return Either 0 in case of failure or the Plugin as QUnknownInterface*
 */
QUnknownInterface* OGenericPluginLoader::load( const OPluginItem& item, const QUuid& uuid) {
    /*
     * Check if there could be a library
     */
    QString pa = item.path();
    if ( pa.isEmpty() )
        return 0l;

    /*
     * See if we get a library
     * return if we've none
     */
    setSafeMode( pa, true );
    QLibrary *lib = Internal::OPluginLibraryHolder::self()->ref( pa );
    if ( !lib ) {
        setSafeMode();
        return 0l;
    }

    /**
     * try to load the plugin and just in case initialize the pointer to a pointer again
     */
    QUnknownInterface*  iface=0;
    if ( lib->queryInterface(  uuid,  &iface ) == QS_OK ) {
        installTranslators( item.name() );
        m_library.insert( iface, lib );
    }else
        iface = 0;

    setSafeMode();

    return iface;
}
Exemplo n.º 3
0
void ScribusQApp::changeGUILanguage(const QString & newGUILang)
{
	QStringList newLangs;
	if (newGUILang.isEmpty())
	{
		newLangs = getLang(QString());
		newLangs.append("en");
	}
	else
		newLangs.append(newGUILang);
	if (newLangs[0] != GUILang)
		installTranslators(newLangs);
}