Esempio n. 1
0
int main(int argc, char *argv[])
{
#if defined(LUGDULOV_MEEGO)
    QCoreApplication::setOrganizationName("net.iksaif.lugdulov");
#else
    QCoreApplication::setOrganizationName("Lugdulov");
#endif
    QCoreApplication::setApplicationName("Lugdulov");
    QCoreApplication::setApplicationVersion(LUGDULOV_VERSION);

#ifdef HAVE_MEEGOTOUCH
    QApplication *app = MDeclarativeCache::qApplication(argc, argv);
#else
    QApplication application(argc, argv);
    QApplication *app = &application;
#endif

    init_translations();
    init_libraries();

    Settings *settings = Settings::settings();
    PluginsModel *plugins = PluginsModel();

    qmlRegisterUncreatableType<Settings>("net.iksaif.lugdulov", 1, 0, "Settings");
    qmlRegisterUncreatableType<PluginsModel>("net.iksaif.lugdulov", 1, 0, "PluginsModel", "This object is created in the model.");
    qmlRegisterUncreatableType<StationsModel>("net.iksaif.lugdulov", 1, 0, "StationsModel", "This object is created in the model.");
    qmlRegisterUncreatableType<StationsSortFilterProxyModel>("net.iksaif.lugdulov", 1, 0, "StationsSortFilterModel", "This object is created in the model.");

#ifdef HAVE_MEEGOTOUCH
    QDeclarativeView *view = MDeclarativeCache::qDeclarativeView();
#else
    QDeclarativeView *view = new QDeclarativeView();
#endif

    QObject::connect(view->engine(), SIGNAL(quit()), app, SLOT(quit()));
    view->rootContext()->setContextProperty("plugins", plugins);
    view->rootContext()->setContextProperty("settings", settings);

#ifdef LUGDULOV_PLATFORM_HARMATTAN
    view->setSource(QUrl("qrc:/qml/harmattan/main.qml"));
    view->showFullScreen();
#elif defined(Q_OS_SYMBIAN)
    view->setSource(QUrl("qrc:/qml/symbian/main.qml"));
    view->showFullScreen();
#else
    view->setSource(QUrl("qrc:/qml/generic/main.qml"));
    view->show();
#endif


    int result = app->exec();
    delete view;
    delete app;
    return result;
}
Esempio n. 2
0
const std::string
stereo_mode_c::translate(unsigned int mode) {
  init_translations();
  return mode < s_translations.size() ? s_translations[mode] : Y("unknown");
}
Esempio n. 3
0
void init_keywords(const struct locale *lang) {
    init_translations(lang, UT_KEYWORDS, keyword_key, MAXKEYWORDS);
}
Esempio n. 4
0
void init_skills(const struct locale *lang) {
    init_translations(lang, UT_SKILLS, skill_key, MAXSKILLS);
}