ApplicationUI::ApplicationUI() :
        QObject()
{
    // prepare the localization
    m_pTranslator = new QTranslator(this);
    m_pLocaleHandler = new LocaleHandler(this);

    bool res = QObject::connect(m_pLocaleHandler, SIGNAL(systemLanguageChanged()), this, SLOT(onSystemLanguageChanged()));
    // This is only available in Debug builds
    Q_ASSERT(res);
    // Since the variable is not used in the app, this is added to avoid a
    // compiler warning
    Q_UNUSED(res);

    // initial load
    onSystemLanguageChanged();

    //TODO: Define your own UUID here. You can generate one here: http://www.guidgenerator.com/
    const QString uuid(QLatin1String(""));

    RegistrationHandler *registrationHandler = new RegistrationHandler(uuid, this);

    ProfileBoxManager *profileBoxManager = new ProfileBoxManager(registrationHandler->context(), this);

    // Whenever the registration has finished successfully, we continue to the main UI
    bool ok = QObject::connect(registrationHandler, SIGNAL(registered()), profileBoxManager, SLOT(show()));
    Q_ASSERT(ok);
    Q_UNUSED(ok);
}
Q_DECL_EXPORT int main(int argc, char **argv)
{
    Application app(argc, argv);

    // localization support
    QTranslator translator;
    const QString locale_string = QLocale().name();
    const QString filename = QString::fromLatin1("bbminvitetodownload_%1").arg(locale_string);
    if (translator.load(filename, "app/native/qm")) {
        app.installTranslator(&translator);
    }

    //TODO: Define your own UUID here. You can generate one here: http://www.guidgenerator.com/
    const QString uuid(QLatin1String(""));

    RegistrationHandler *registrationHandler = new RegistrationHandler(uuid, &app);

    InviteToDownload *inviteToDownload = new InviteToDownload(registrationHandler->context(), &app);

    bool ok = QObject::connect(registrationHandler, SIGNAL(registered()), inviteToDownload, SLOT(show()));
    Q_ASSERT(ok);
    Q_UNUSED(ok);

    return Application::exec();
}
示例#3
0
Q_DECL_EXPORT int main(int argc, char **argv) {
	qmlRegisterType<QuranDbHelper>("dbutils", 1, 0, "QuranDbHelper");
	// this is where the server is started etc
	Application app(argc, argv);

	// localization support
	QTranslator translator;
	QString locale_string = QLocale().name();
	QString filename = QString("Quran_%1").arg(locale_string);
	if (translator.load(filename, "app/native/qm")) {
		app.installTranslator(&translator);
	}

	//new Quran(&app);
	// 2b078efb-bf88-4038-aa36-5f52ae35eeac
	const QString uuid(QLatin1String("348ccad0-411f-11e2-a25f-0800200c9a66"));

	//! [0]
	RegistrationHandler *registrationHandler = new RegistrationHandler(uuid,
			&app);

	Quran *quranApp = new Quran(registrationHandler->context(), &app);

	//Whenever the registration has finished successfully, we continue to the main UI
	QObject::connect(registrationHandler, SIGNAL(registered()), quranApp,
			SLOT(show()));

	// we complete the transaction started in the app constructor and start the client event loop here
	return Application::exec();
	// when loop is exited the Application deletes the scene which deletes all its children (per qt rules for children)
}
示例#4
0
Q_DECL_EXPORT int main(int argc, char **argv)
{
    // this is where the server is started etc
    Application app(argc, argv);

    // localization support
    QTranslator translator;
    QString locale_string = QLocale().name();
    QString filename = QString( "NewsSpot_%1" ).arg( locale_string );
    if (translator.load(filename, "app/native/qm")) {
        app.installTranslator( &translator );
    }

    // create the application pane object to init UI etc.
    // BBM social platform connect
    const QString uuid("8aa6f6df-5c69-4df2-81f2-49aba8a03f9c");
    RegistrationHandler *registrationHandler = new RegistrationHandler(uuid, &app);

    NewsSpot *newsSpot = new NewsSpot(registrationHandler->context(), &app);
    QObject::connect(registrationHandler, SIGNAL(registered()), newsSpot, SLOT(show()));

    // we complete the transaction started in the app constructor and start the client event loop here
    return Application::exec();
    // when loop is exited the Application deletes the scene which deletes all its children (per qt rules for children)
}
int main(int argc, char **argv)
{
    Application app(argc, argv);

    // localization support
    QTranslator translator;
    const QString locale_string = QLocale().name();
    const QString filename = QString::fromLatin1("bbmprofilebox_%1").arg(locale_string);
    if (translator.load(filename, "app/native/qm")) {
        app.installTranslator(&translator);
    }

    //TODO: Define your own UUID here. You can generate one here: http://www.guidgenerator.com/
    const QString uuid(QLatin1String(""));

//! [0]
    RegistrationHandler *registrationHandler = new RegistrationHandler(uuid, &app);

    ProfileBoxManager *profileBoxManager = new ProfileBoxManager(registrationHandler->context(), &app);

    // Whenever the registration has finished successfully, we continue to the main UI
    bool ok = QObject::connect(registrationHandler, SIGNAL(registered()), profileBoxManager, SLOT(show()));
    Q_ASSERT(ok);
    Q_UNUSED(ok);
//! [0]

    return Application::exec();
}
示例#6
0
Q_DECL_EXPORT int main(int argc, char **argv)
{
    // this is where the server is started etc
    Application app(argc, argv);

    // localization support
    QTranslator translator;
    QString locale_string = QLocale().name();
    QString filename = QString( "Monitor_%1" ).arg( locale_string );
    if (translator.load(filename, "app/native/qm")) {
        app.installTranslator( &translator );
    }

    // BBM social platform connect
	const QString uuid("c6144f34-3b74-4c38-81cc-e8db14a208e0");
	RegistrationHandler *registrationHandler = new RegistrationHandler(uuid, &app);

	ApplicationUI *appUi = new ApplicationUI(registrationHandler->context(), &app);
    QObject::connect(registrationHandler, SIGNAL(registered()), appUi, SLOT(show()));

    // we complete the transaction started in the app constructor and start the client event loop here
    return Application::exec();
    // when loop is exited the Application deletes the scene which deletes all its children (per qt rules for children)
}
ApplicationUI::ApplicationUI(bb::cascades::Application *app) :
		QObject(app) {
	DataBaseController *dataBaseController = DataBaseController::getInstance(
			this);
	QmlDocument::defaultDeclarativeEngine()->rootContext()->setContextProperty(
			"_db", dataBaseController);
	ApplicationInfo::registerQmlTypes();
	SqlDataModel::registerQmlTypes();
	// prepare the localization
	m_pTranslator = new QTranslator(this);
	m_pLocaleHandler = new LocaleHandler(this);

	DataBaseController::createDB();
	DataBaseController::createTables();

	bool res = QObject::connect(m_pLocaleHandler,
			SIGNAL(systemLanguageChanged()), this,
			SLOT(onSystemLanguageChanged()));
	// This is only available in Debug builds
	Q_ASSERT(res);
	// Since the variable is not used in the app, this is added to avoid a
	// compiler warning
	Q_UNUSED(res);

	// initial load
	onSystemLanguageChanged();

	// Create scene document from main.qml asset, the parent is set
	// to ensure the document gets destroyed properly at shut down.
	QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);

//    const QString uuid(QLatin1String("76a353d0-bd9c-11e3-b1b6-0800200c9a66")); // full version
	const QString uuid(QLatin1String("f0af2ec0-bd9b-11e3-b1b6-0800200c9a66")); // free version
	RegistrationHandler *registrationHandler = new RegistrationHandler(uuid,
			app);
	m_inviteToDownload = new InviteToDownload(registrationHandler->context(),
			app);
	res = connect(registrationHandler, SIGNAL(registered()), m_inviteToDownload,
			SLOT(show()));
	Q_ASSERT(res);
	Q_UNUSED(res);

	ActiveFrameQML *activeFrame = new ActiveFrameQML(this);
	Application::instance()->setCover(activeFrame);

	// Create root object for the UI
	AbstractPane *root = qml->createRootObject<AbstractPane>();
	qml->setContextProperty("_app", this);
	qml->documentContext()->setContextProperty("_settings",
			Settings::getInstance(this));
	qml->documentContext()->setContextProperty("_notification",
			new Notification(this));
	qml->documentContext()->setContextProperty("_packageCtrl",
			PackagesController::getInstance(this));
	Settings::getInstance(this)->setParent(this);
	Settings::getInstance(this)->emitObjectName("last_update_date");

	registrationHandler->registerApplication();

	// Set created root object as the application scene
	app->setScene(root);
}