Beispiel #1
0
int main(int argc, char ** argv)
{
    bool CLIdone = false;
    for(int i=1; i<argc; i++){ //skip the first arg (app binary)
      if(QString(argv[i]) == "--reset-monitors"){
        RRSettings::ApplyPrevious();
        CLIdone = true;
        break;
      }
    }
    if(CLIdone){ return 0; }
   LTHEME::LoadCustomEnvSettings();
    LSingleApplication a(argc, argv, "lumina-xconfig"); //loads translations inside constructor
      if( !a.isPrimaryProcess()){ return 0; }
    //qDebug() << "Loaded QApplication";
    a.setApplicationName("Lumina Screen Configuration");
    LuminaThemeEngine themes(&a);

    //Start the UI
    MainUI w;
    QObject::connect(&a, SIGNAL(InputsAvailable(QStringList)), &w, SLOT(slotSingleInstance()) );
    QObject::connect(&themes, SIGNAL(updateIcons()), &w, SLOT(loadIcons()) );
    w.show();

    int retCode = a.exec();
    return retCode;
}
Beispiel #2
0
int main( int argc, char ** argv )
{
    //Check for root permissions
    if( getuid() != 0){
      qDebug() << "pc-softwaremanager must be started as root!";
      return system("pc-su pc-softwaremanager");
    }
    qDebug() << "Starting Up the AppCafe";
    PCSingleApplication a(argc, argv);   
    if ( !a.isPrimaryProcess() ){
      qDebug() << " - an instance of the AppCafe is already running";
      return 0;
    }

    QTranslator translator;
    QLocale mylocale;
    QString langCode = mylocale.name();
    if ( ! QFile::exists( PREFIX + "/share/pcbsd/i18n/SoftwareManager_" + langCode + ".qm" ) )
      langCode.truncate(langCode.indexOf("_"));
    translator.load( QString("SoftwareManager_") + langCode, PREFIX + "/share/pcbsd/i18n/" );
    a.installTranslator( &translator );
    qDebug() << "Locale:" << langCode;
    QTextCodec::setCodecForLocale( QTextCodec::codecForName("UTF-8") ); //Force Utf-8 compliance
    
    //Check for the old PBI system, and prompt to migrate if needed
    QDir dir("/var/db/pbi/installed");
    if( !dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot).isEmpty() ){
      QPixmap pix(":/icons/splash.png");
      QSplashScreen SS(0, pix,  Qt::WindowStaysOnTopHint);
	SS.showMessage(QObject::tr("Updating Index"), Qt::AlignHCenter | Qt::AlignBottom);
	SS.show();
	a.processEvents();
	a.processEvents();
	if ( QProcess::execute("pbi_updateindex") != 0 )
        {
	  QMessageBox::critical( 0, QObject::tr("Failed to update index!"), QObject::tr("Failed to contact the index server. Please check your network connection before trying to install / update applications."));
	}
      //Still on the old system - prompt to migrate to PBI-NG
      MigrateUI w;
      w.show();
      SS.finish(&w);
      QObject::connect(&a, SIGNAL(InputsAvailable(QStringList)), &w, SLOT(slotSingleInstance()) );
      a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
      return a.exec();
    }else{
      //Already on PBI-NG
      MainUI w; 
      w.ProgramInit();
      if(argc >= 3 && QString(argv[1])=="-jail"){
	QString jailname = argv[2];
	qDebug() << " - Loading Jail:" << jailname;
        w.showJail( jailname );
      }
      w.show();

      QObject::connect(&a, SIGNAL(InputsAvailable(QStringList)), &w, SLOT(slotSingleInstance()) );
      a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
      return a.exec();
    }
}
Beispiel #3
0
int main(int argc, char ** argv)
{
    QStringList in;
    for(int i=1; i<argc; i++){ //skip the first arg (app binary)
      in << QString(argv[i]);
    }
    if(in.isEmpty()){ in << QDir::homePath(); }
    #ifdef __linux
    QApplication a(argc, argv);
    #else
    QtSingleApplication a(argc, argv);
    if( a.isRunning() ){
      return !(a.sendMessage(in.join("\n")));
    }
    #endif
    QTranslator translator;
    QLocale mylocale;
    QString langCode = mylocale.name();
    
    if ( ! QFile::exists(PREFIX + "/share/Lumina-DE/i18n/lumina-config_" + langCode + ".qm" ) )  langCode.truncate(langCode.indexOf("_"));
    translator.load( QString("lumina-config_") + langCode, PREFIX + "/share/i18n/Lumina-DE/" );
    a.installTranslator( &translator );
    qDebug() << "Locale:" << langCode;
    
    MainUI w;
    QObject::connect(&a, SIGNAL(messageReceived(const QString&)), &w, SLOT(slotSingleInstance(const QString&)) );
    w.OpenDirs(in);
    w.show();

    int retCode = a.exec();
    return retCode;
}
Beispiel #4
0
int main(int argc, char *argv[])
{
	QApplication a(argc, argv);
	MainUI w;
	w.show();
	return a.exec();
}
Beispiel #5
0
int main(int argc, char ** argv)
{
    #ifdef __linux
    QApplication a(argc, argv);
    #else
    QtSingleApplication a(argc, argv);
    if( a.isRunning() )
      return !(a.sendMessage("show"));
    #endif
    QTranslator translator;
    QLocale mylocale;
    QString langCode = mylocale.name();
    
    if ( ! QFile::exists(PREFIX + "/share/Lumina-DE/i18n/lumina-config_" + langCode + ".qm" ) )  langCode.truncate(langCode.indexOf("_"));
    translator.load( QString("lumina-config_") + langCode, PREFIX + "/share/i18n/Lumina-DE/" );
    a.installTranslator( &translator );
    qDebug() << "Locale:" << langCode;
    

    MainUI w;
    QObject::connect(&a, SIGNAL(messageReceived(const QString&)), &w, SLOT(slotSingleInstance()) );
    w.show();

    int retCode = a.exec();
    return retCode;
}
Beispiel #6
0
Q_DECL_EXPORT int main(int argc, char *argv[])
{
#ifdef Q_WS_X11
	QApplication::setAttribute(Qt::AA_X11InitThreads, true);
#endif
	QApplication a(argc, argv);
	QSize res = QApplication::desktop()->screenGeometry().size();
	if (res.width() < res.height())
		res.transpose();
	pixel_xres = res.width();
	pixel_yres = res.height();

	g_dpi_scale = CalculateDPIScale();
	dp_xres = (int)(pixel_xres * g_dpi_scale); dp_yres = (int)(pixel_yres * g_dpi_scale);
	net::Init();
#ifdef __SYMBIAN32__
	char* savegame_dir = "E:/PPSSPP/";
	char* assets_dir = "E:/PPSSPP/";
#elif defined(BLACKBERRY)
	char* savegame_dir = "/accounts/1000/shared/misc/";
	char* assets_dir = "app/native/assets/";
#elif defined(MEEGO_EDITION_HARMATTAN)
	char* savegame_dir = "/home/user/MyDocs/PPSSPP/";
	QDir myDocs("/home/user/MyDocs/");
	if (!myDocs.exists("PPSSPP"))
		myDocs.mkdir("PPSSPP");
	char* assets_dir = "/opt/PPSSPP/";
#else
	char* savegame_dir = "./";
	char* assets_dir = "./";
#endif
	NativeInit(argc, (const char **)argv, savegame_dir, assets_dir, "BADCOFFEE");

#if !defined(Q_WS_X11) || defined(ARM)
	MainUI w;
	w.resize(pixel_xres, pixel_yres);
	w.showFullScreen();
#endif
#ifdef __SYMBIAN32__
	// Set RunFast hardware mode for VFPv2.
	User::SetFloatingPointMode(EFpModeRunFast);
	// Disable screensaver
	QSystemScreenSaver *ssObject = new QSystemScreenSaver(&w);
	ssObject->setScreenSaverInhibit();
#endif

	MainAudio *audio = new MainAudio();

	int ret = a.exec();
	delete audio;
	NativeShutdown();
	net::Shutdown();
	return ret;
}
Beispiel #7
0
int main(int argc, char *argv[])
{
	QApplication a(argc, argv);

	//QTextCodec::setCodecForCStrings(QTextCodec::codecForName("gbk"));
	//QApplication::setFont(QFont("Times", 11, QFont::Light));	
	//QApplication::setStyle(QStyleFactory::create("cleanlooks"));

	MainUI w;
	w.showMaximized();
	return a.exec();
}
Beispiel #8
0
int main(int argc, char ** argv)
{
    LTHEME::LoadCustomEnvSettings();
    QApplication a(argc, argv);
    LUtils::LoadTranslation(&a, "lumina-fileinfo");
    LuminaThemeEngine theme(&a);


    //Read the input variables
    QString path = "";
    QString flag = "";
    if (argc==2) {
        path = QString::fromLocal8Bit(argv[1]);
    } else if (argc==3) {
        flag = QString::fromLocal8Bit(argv[1]);
        path = QString::fromLocal8Bit(argv[2]);
    }
    //Check the input variables
    // - path
    if(!path.isEmpty()) {
        path = LUtils::PathToAbsolute(path);
    }
    // - flag
    if(!flag.isEmpty()) {
        if(flag=="-application") {
            flag = "APP"; //for internal use
        } else if(flag=="-link") {
            flag = "LINK"; //for internal use
        } else {
            //Invalid flag - clear the path as well
            path.clear();
        }
    }
    if(!path.isEmpty()) {
        //if(!QFile::exists(path)){ LUtils::writeFile(path,QStringList()); } //create an empty file
        MainUI w;
        QObject::connect(&theme, SIGNAL(updateIcons()), &w, SLOT(UpdateIcons()) );
        w.LoadFile(path, flag);
        w.show();
        int retCode = a.exec();
        return retCode;
    } else {
        //Show an error text and exit
        QStringList msg;
        msg << "ERROR: Invalid input arguments";
        msg << "Usage: \"lumina-fileinfo [-application | -link] <file>";
        qDebug() << msg.join("\n");
        return 1;
    }


}
Beispiel #9
0
int main(int argc, char ** argv)
{
    QStringList in;
    for(int i=1; i<argc; i++){ //skip the first arg (app binary)
      QString path = argv[i];
      if(path=="."){
	//Insert the current working directory
	in << QDir::currentPath();
      }else{
	if(!path.startsWith("/")){ path.prepend(QDir::currentPath()+"/"); }
        in << path;
      }
    }
    if(in.isEmpty()){ in << QDir::homePath(); }
    #ifdef __FreeBSD__
    QtSingleApplication a(argc, argv);
    if( a.isRunning() ){
      return !(a.sendMessage(in.join("\n")));
    }
    #else
    QApplication a(argc, argv);
    #endif
    a.setApplicationName("Insight File Manager");
    LuminaThemeEngine themes(&a);
    //Load current Locale
    QTranslator translator;
    QLocale mylocale;
    QString langCode = mylocale.name();

    if ( ! QFile::exists(LOS::LuminaShare()+"i18n/lumina-fm_" + langCode + ".qm" ) )  langCode.truncate(langCode.indexOf("_"));
    translator.load( QString("lumina-fm_") + langCode, LOS::LuminaShare()+"i18n/" );
    a.installTranslator( &translator );
    qDebug() << "Locale:" << langCode;

    //Load current encoding for this locale
    QTextCodec::setCodecForTr( QTextCodec::codecForLocale() ); //make sure to use the same codec
    qDebug() << "Locale Encoding:" << QTextCodec::codecForLocale()->name();

    MainUI w;
    QObject::connect(&a, SIGNAL(messageReceived(const QString&)), &w, SLOT(slotSingleInstance(const QString&)) );
    QObject::connect(&themes, SIGNAL(updateIcons()), &w, SLOT(setupIcons()) );
    w.OpenDirs(in);
    w.show();

    int retCode = a.exec();
    return retCode;
}
Beispiel #10
0
int main(int argc, char** argv) {
	QApplication qapp(argc, argv);

	MainUI mainui;
	/*std::cout << "argc: " << argc << std::endl;
	std::cout << "argv: " << argv << std::endl;*/
	mainui.resize(390, 90);

	// Prepare and set window title
	std::stringstream ss;
	ss << "APK Installer " << APKI_VERSION;
	mainui.setWindowTitle(ss.str().c_str());

	mainui.show();

	return qapp.exec();
};
Beispiel #11
0
int main(int argc, char ** argv)
{
  LTHEME::LoadCustomEnvSettings();
  QApplication a(argc, argv);
  LUtils::LoadTranslation(&a, "lumina-fileinfo");
  LuminaThemeEngine theme(&a);


  //Read the input variables
  QString path = "";
  QString flag = "";
  for(int i=1; i<argc; i++){
    if( QString(argv[i]).startsWith("-") ){ flag = QString(argv[i]); }
    else{ path = QString(argv[i]); break; }
  }
  //Check the input variables
  // - path
  if(!path.isEmpty()){ path = LUtils::PathToAbsolute(path); }
  // - flag
  if(!flag.isEmpty()){
    if(flag=="-application"){
      flag = "APP"; //for internal use
    }else if(flag=="-link"){
      flag = "LINK"; //for internal use
    }else{
      //Invalid flag - clear the path as well
      flag.clear();
      path.clear();
    }
  }
  if(!path.isEmpty() || !flag.isEmpty()){ 
    MainUI w;
      QObject::connect(&theme, SIGNAL(updateIcons()), &w, SLOT(UpdateIcons()) );
    w.LoadFile(path, flag);
    w.show();
    int retCode = a.exec();
    return retCode;
  }else{
    //Show an error text and exit
    qDebug() << "ERROR: Invalid input arguments";
    qDebug() << "Usage: \"lumina-fileinfo [-application | -link] [file]";
    return 1;
  }


}
Beispiel #12
0
int  main(int argc, char *argv[]) {
   LTHEME::LoadCustomEnvSettings();
   QApplication a(argc, argv);
    a.setAttribute(Qt::AA_UseHighDpiPixmaps);
   LUtils::LoadTranslation(&a, "l-archiver");
   //Now go ahead and setup the app
   QStringList args;
   for(int i=1; i<argc; i++){
      if( QString(argv[i]).startsWith("--") ){ args << QString(argv[i]); }
      else{ args << LUtils::PathToAbsolute( QString(argv[i]) ); }
   }
   //Now start the window
   MainUI W;
    W.LoadArguments(args);
   W.show();
   return  a.exec();
}
Beispiel #13
0
int main(int argc, char ** argv)
{
    QApplication a(argc, argv);
    a.setApplicationName("Take Screenshot");
    QTranslator translator;
    QLocale mylocale;
    QString langCode = mylocale.name();
    
    if ( ! QFile::exists(PREFIX + "/share/Lumina-DE/i18n/lumina-screenshot_" + langCode + ".qm" ) )  langCode.truncate(langCode.indexOf("_"));
    translator.load( QString("lumina-screenshot_") + langCode, PREFIX + "/share/i18n/Lumina-DE/" );
    a.installTranslator( &translator );
    qDebug() << "Locale:" << langCode;
    
    MainUI w;
    w.show();

    return a.exec();
}
Beispiel #14
0
int main(int argc, char ** argv)
{
    //qDebug() << "Create Single Application";
    LSingleApplication a(argc, argv, "lumina-info"); //loads translations inside constructor
      if( !a.isPrimaryProcess()){ return 0; }
    //qDebug() << "Set Application Name";
    a.setApplicationName("About Lumina-DE");
    //qDebug() << "Load Theme Engine";
    LuminaThemeEngine themes(&a);
    //qDebug() << "Start the UI";
    //Start the UI
    MainUI w;
    QObject::connect(&a, SIGNAL(InputsAvailable(QStringList)), &w, SLOT(slotSingleInstance()) );
    w.show();

    int retCode = a.exec();
    return retCode;
}
Beispiel #15
0
int main(int argc, char ** argv)
{
    QApplication a(argc, argv);
    LuminaThemeEngine theme(&a);
    a.setApplicationName("Search for...");
    QTranslator translator;
    QLocale mylocale;
    QString langCode = mylocale.name();

    if ( ! QFile::exists(LOS::LuminaShare()+"i18n/lumina-search_" + langCode + ".qm" ) )  langCode.truncate(langCode.indexOf("_"));
    translator.load( QString("lumina-search_") + langCode, LOS::LuminaShare()+"i18n/" );
    a.installTranslator( &translator );
    qDebug() << "Locale:" << langCode;

    MainUI w;
    QObject::connect(&theme,SIGNAL(updateIcons()), &w, SLOT(setupIcons()) );
    w.show();

    return a.exec();
}