void HomeScreenStatePluginTest::testLoadBackupRestoreStateOnEntryExit()
{
    HbInstance::instance();
    HbMainWindow mainWindow;
    mainWindow.show();   
    QCoreApplication::sendPostedEvents();
   
    QStateMachine *sm = new QStateMachine;
    HsBackupRestoreState *brs = new HsBackupRestoreState;

    sm->addState(brs);
    sm->setInitialState(brs);    
    

    QFinalState *fs = new QFinalState;
    sm->addState(fs);

    brs->addTransition(this, SIGNAL(finishStateMachine()), fs);

    sm->start();   
    QCoreApplication::sendPostedEvents();  
    emit finishStateMachine();

    sm->stop();
    // main window deleted -> HsGui must be deleted also
    delete HsGui::takeInstance();
    delete sm;
}
Exemplo n.º 2
0
/*!
	The main entry point of the clock application.

	Constructs the view manager object.
 */
int main(int argc, char *argv[])
{
	OstTraceFunctionEntry0( _MAIN_ENTRY );
	// Create and initialize an ClockApplication instance
	QScopedPointer<ClockApplication> application(
				new ClockApplication(argc, argv));
	
	// Main window widget.
	// Includes decorator such as signal strength and battery life indicator.
	HbMainWindow window;
	window.setRenderHints(
			QPainter::HighQualityAntialiasing | QPainter::SmoothPixmapTransform);
	window.setViewportUpdateMode(QGraphicsView::MinimalViewportUpdate);

	// Load the translation file.
	HbTranslator translator("clock");
	translator.loadCommon();
	
	// Construct the application controller.
	application->createController();

	// Show widget
	window.show();

	// Start the event loop for the application
	return application->execution();
}
Exemplo n.º 3
0
/*!
	The main() function.

	Responsible for constructing the NotesApplication object and showing the
	main window.
 */
int main(int argc, char *argv[])
{
	OstTraceFunctionEntry0( _MAIN_ENTRY );
	// Create and initialize an NotesApplication instance
	QScopedPointer<NotesApplication> application(
			new NotesApplication(argc, argv));
	//NotesApplication *application = new NotesApplication(argc, argv);

	// Main window for providing the scene context
	HbMainWindow window;
	window.setRenderHints(
			QPainter::Antialiasing | QPainter::SmoothPixmapTransform);
	window.setViewportUpdateMode(QGraphicsView::MinimalViewportUpdate);

	// Load the translation file.
	HbTranslator notesViewsTranslator("notes");
	notesViewsTranslator.loadCommon();

	// Construct the application controller.
	application->createController();
	
	// Show the main window.
	window.show();
	
	// Start the event loop for the application
	return application->execution();
}
Exemplo n.º 4
0
int main(int argc, char *argv[])
{
    qDebug () << "AUTOMATICANSWER__main()<<";
    HbApplication app (argc, argv);    
    HbMainWindow mainWindow;
    automaticanswertest* testview = new automaticanswertest ();
    mainWindow.addView(testview);
    mainWindow.setCurrentView(testview);
    mainWindow.show();
    return app.exec();
}
/*!
 onEntry method invoked on entering the state
 \param event: event
 \retval void
 */
void HsViewAppSettingsState::onEntry(QEvent *event)
{
    HSMENUTEST_FUNC_ENTRY("HsViewAppSettingsState::onEntry");
    QState::onEntry(event);
    qDebug("CollectionState::onEntry()");
    HsMenuEvent *menuEvent = static_cast<HsMenuEvent *>(event);
    QVariantMap data = menuEvent->data();
    
    const int entryId = data.value(Hs::itemIdKey).toInt();   
    QSharedPointer<const CaEntry> entry = CaService::instance()->getEntry(entryId);    
    
    QString pluginPath;
    pluginPath = pluginPath.append("/resource/qt/plugins/appsettings/")
        .append(entry->attribute(Hs::appSettingsPlugin)).append(".qtplugin");
    QPluginLoader loader(pluginPath);
    mView = qobject_cast<HbView *>(loader.instance()); 
    
    mActionConfirm = new HbAction(Hb::ConfirmNaviAction, mView);
    connect(mActionConfirm, SIGNAL(triggered()), SIGNAL(exit()));
    
    if (mView) {    
        QScopedPointer<HsMenuEntryRemovedHandler> entryObserver(
            new HsMenuEntryRemovedHandler(entryId, this, SIGNAL(exit())));
        
        entryObserver.take()->setParent(mView);
        // remove it when JAVA will start to provide only version with two strings
        QObject::connect(this, SIGNAL(initialize(QString, QString)), mView, SLOT(initialize(QString)));        
        QObject::connect(this, SIGNAL(initialize(QString, QString)), mView, SLOT(initialize(QString, QString)));
        mView->setParent(this);
        emit initialize(entry->attribute(Hs::applicationUidEntryKey), entry->text());        
        // Add View to main window
        HbMainWindow *hbMainWindow = mainWindow();
        // add confirm action
        mView->setNavigationAction(mActionConfirm);
    
        hbMainWindow->addView(mView);
        // record the current view in order to activate it once done
        mPreviousView = hbMainWindow->currentView();
        hbMainWindow->setCurrentView(mView);
        hbMainWindow->show();
    }

    
    HSMENUTEST_FUNC_EXIT("HsViewAppSettingsState::onEntry");
}
Exemplo n.º 6
0
int main(int argc, char *argv[])
{
    // Initialization
    HbApplication app(argc, argv);

    // Main window widget. 
    // Includes decorators such as signal strength and battery life indicator.
    HbMainWindow mainWindow;

    // View
    BubbleTestView *view = new BubbleTestView(mainWindow);
    mainWindow.addView(view);

    // Show widget
    mainWindow.setAttribute( Qt::WA_InputMethodEnabled, false ); 
    mainWindow.show();
    
    mainWindow.scene()->setFocusItem( view );

    // Enter event loop
    return app.exec();
}
Exemplo n.º 7
0
int main(int argc, char *argv[])
{
#ifdef THEME_CHANGER_TIMER_LOG
    qInstallMsgHandler(debugOutput);
#endif
    // Initialization
    HbApplication app(argc, argv);
    app.setApplicationName("ThemeChanger");
    // Main window widget. 
    // Includes decorators such as signal strength and battery life indicator.
    HbMainWindow mainWindow;
    
    // Show the list of themes available
    ThemeSelectionList *themelist=new ThemeSelectionList(&mainWindow);
    themelist->displayThemes();
    
    mainWindow.addView( themelist );

    // Show widget
    mainWindow.show();
    // Enter event loop
    return app.exec();
}