Exemplo n.º 1
0
int main (int argc, char **argv) {
    MApplication app (argc, argv);
    
    MApplicationWindow * window = new MApplicationWindow();
    window->show();

    Page * page = new Page();
    page->appear (window);

    return app.exec();
}
Exemplo n.º 2
0
M_EXPORT int main(int argc, char *argv[]){
    MApplication* application = MComponentCache::mApplication(argc, argv);
    application->setOrganizationName("arcean");
    application->setOrganizationDomain("arcean.com");
    application->setApplicationName("foss-calc");

    MApplicationWindow* window = MComponentCache::mApplicationWindow();
    MainPage page;

    page.appear(window);

    window->showFullScreen();

    return application->exec();
 }
Exemplo n.º 3
0
M_EXPORT int main (int argc, char **argv) {

    bool run_standalone = true;
    
    QCoreApplication::setApplicationName (QLatin1String ("Share UI"));
    QCoreApplication::setOrganizationName (QLatin1String ("MeeGo"));    
    
    // Let's use custom logging
    Logger logger;    

    // Use dynamic memory control to make sure free is successfull before we
    // print out bye message.
    MApplication * app = MComponentCache::mApplication (argc, argv);

    // Load the translation catalog. The engineering english catalog is per
    // application/package, and gets loaded automatically. In the device, there
    // will be only one translation catalog for share-ui, webupload-engine and
    // transfer-ui, and we need to explicitly load it
    MLocale locale;
    locale.installTrCatalog ("transfer");
    MLocale::setDefault (locale);

    Service * service = new Service();

    for(int i = 1; i < argc; i++) {
        if (strcmp(argv[i], "--service") == 0) {
            run_standalone = false;
        } else if (strcmp(argv[i], "--help") == 0) {
            std::cout << "Share UI command line usage is" << std::endl;
            std::cout << "\tshare-ui <file list>" << std::endl;
            exit(0);
        }
    }

    if (run_standalone == true) {
        QStringList itemList;

        for (int i = 1; i < argc; i++) {
            if(argv[i][0] == '-') {
                // This is probably some kind of argument, like -software
                continue;
            }
            
            QString input = argv[i];
            
            if (input.startsWith ("data:") == true) {
                qDebug() << "Received data URI" << input;
                itemList << input;
            } else {
                QFileInfo fileInfo (input);
                QString fileUri = fileInfo.canonicalFilePath();
                if (fileUri.isEmpty ()) {
                    qDebug() << "Received Tracker IRI (?)" << input;
                    itemList << input;
                } else {
                    fileUri.prepend("file://");
                    qDebug() << "Received file path uri" << fileUri;
                    itemList << fileUri;
                }
            }
        }

        service->share (itemList);
        
    } else {

        new ShareUiInterfaceAdaptor (service);

        QDBusConnection connection = QDBusConnection::sessionBus();
        bool retA = connection.registerService("com.nokia.ShareUi");
        bool retB = connection.registerObject("/", service);
        qDebug() << "Setup dbus connection" << retA << retB;
    }
    
    int mainRes = app->exec();  
    qDebug() << "app returned" << mainRes;
    
    delete service;
    delete app;
    
    qDebug() << "Clean shutdown of Share UI application";
    return mainRes;
}
M_EXPORT int main(int argc, char ** argv)
{
    MApplication *app = new MApplication(argc, argv);
    app->exec();
}