Exemplo n.º 1
0
int main(int argc, char **argv)
{
    KAboutData about("active-documentviewer", 0, ki18n("Reader"), version, ki18n(description),
                     KAboutData::License_GPL, ki18n("Copyright 2012 Marco Martin"), KLocalizedString(), 0, "*****@*****.**");
                     about.addAuthor( ki18n("Marco Martin"), KLocalizedString(), "*****@*****.**" );
    about.setProgramIconName("okular");

    KCmdLineArgs::init(argc, argv, &about);

    KCmdLineOptions options;
    options.add("+[url]", ki18n( "URL of the file to open" ));

    KCmdLineArgs::addCmdLineOptions(options);
    KApplication app;

    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();

    KGlobal::locale()->insertCatalog("org.kde.okular");
    //kDebug() << "ARGS:" << args << args->count();

    KDeclarativeMainWindow *mainWindow = new KDeclarativeMainWindow();
    mainWindow->declarativeView()->setPackageName("org.kde.active.documentviewer");
    mainWindow->show();
    args->clear();
    return app.exec();
}
Exemplo n.º 2
0
int main(int argc, char **argv)
{
    const char *version = "0.5";
    KLocalizedString description = ki18n("Unit test for .netrc and kionetrc parser.");
    KCmdLineOptions options;
    options.add("+command", ki18n("[url1,url2 ,...]"));

    KCmdLineArgs::init( argc, argv, "kionetrctest", 0, ki18n("KIO-netrc-test"), version, description );
    KCmdLineArgs::addCmdLineOptions( options );
    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
    int count = args->count();
    KApplication app;

    if ( !count )
        args->usage();
    else
    {
        KUrl u;
        for( int i=0 ; i < count; i++ )
        {
            u = args->arg(i);
            if ( !u.isValid() )
            {
                kDebug() << u.url() << " is invalid! Ignoring...";
                continue;
            }
            output( u );
        }
    }
    args->clear();
    return 0;
}
Exemplo n.º 3
0
int main( int argc, char* argv[] )
{
   PMShell* shell = 0;

   KCmdLineArgs::init( argc, argv, PMFactory::aboutData( ) );
   KCmdLineArgs::addCmdLineOptions( options );

   KApplication app;

   KCmdLineArgs* args = KCmdLineArgs::parsedArgs( );

   if( !args->isSet( "-opengl" ) )
      PMRenderManager::disableOpenGL( );
   if( !args->isSet( "-dri" ) )
      PMGLView::enableDirectRendering( false );

   if( args->count( ) > 0 )
   {
      for( int i = 0 ; i < args->count( ) ; i++ )
      {
         shell = new PMShell( args->url( i ) );
         shell->show( );
      }
   }
   else
   {
      shell = new PMShell;
      shell->show( );
   }
   args->clear();   
   return app.exec( );
}
Exemplo n.º 4
0
int AlarmDaemonApp::newInstance()
{
	kdDebug(5900) << "AlarmDaemonApp::newInstance()" << endl;

	/* Prevent the application being restored automatically by the session manager
	 * at session startup. Instead, the KDE autostart facility is used to start
	 * the application. This allows the user to configure whether or not it is to
	 * be started automatically, and also ensures that it is started in the correct
	 * phase of session startup, i.e. after clients have been restored by the
	 * session manager.
	 */
	disableSessionManagement();

	// Check if we already have a running alarm daemon widget
	if (mAd)
		return 0;

	// Check if we are starting up at session startup
	static bool restored = false;
	bool autostart = false;
	if (!restored  &&  isRestored())
		restored = true;       // make sure we restore only once
	else
	{
		KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
		autostart = args->isSet("autostart");
		args->clear();      // free up memory
	}

	mAd = new AlarmDaemon(autostart, 0, DAEMON_DCOP_OBJECT);

	return 0;
}
Exemplo n.º 5
0
Arquivo: main.cpp Projeto: KDE/kooka
int main( int argc, char *argv[] )
{
    KAboutData about("kooka",				// appName
                     "",				// catalogName
                     ki18n("Kooka"),			// programName
#if VCS_AVAILABLE
                     (VERSION " (" VCS_TYPE " " VCS_REVISION ")"),
#else
                     VERSION,				// version
#endif
                     ki18n(shortDesc),			// shortDescription
                     KAboutData::License_GPL_V2,	// licenseType
                     ki18n(copyright),			// copyrightStatement
                     ki18n(longDesc),			// text
                     "http://techbase.kde.org/Projects/Kooka");

    about.addAuthor(ki18n("Jonathan Marten"), ki18n("Current maintainer, KDE4 port"), "*****@*****.**");
    about.addAuthor(ki18n("Klaas Freitag"), ki18n("Developer"), "*****@*****.**");
    about.addCredit(ki18n("Mat Colton"), ki18n("Graphics, web"), "*****@*****.**");
    about.addCredit(ki18n("Ivan Shvedunov"), ki18n("Original kscan application"), "*****@*****.**");
    about.addCredit(ki18n("Alex Kempshall"), ki18n("Photocopy facility"), "*****@*****.**");
    about.addLicenseText(ki18n(addLicense));

    KCmdLineArgs::init(argc, argv, &about);

    KCmdLineOptions options;
    options.add("d <device>", ki18n("The SANE device specification (e.g. 'umax:/dev/sg0')"));
    options.add("g", ki18n("Gallery mode - do not connect to scanner"));
    KCmdLineArgs::addCmdLineOptions(options);		// Add my own options

    KApplication app;
    KGlobal::locale()->insertCatalog("libkscan");

    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
    QString devToUse = args->getOption("d");
    if (args->isSet("g"))
    {
        devToUse = "gallery";
    }
    kDebug() << "DevToUse is" << devToUse;

// TODO: not sure what this did
//    if (args->count()==1)
//    {
//        args->usage();
//        // exit(-1);
//    }

    // TODO: try ScanGlobal::init(), if that fails no point in carrying on
    // so show an error box and give up (or can we carry on and run in
    // gallery mode only?)

    Kooka *kooka = new Kooka(devToUse.toLocal8Bit());
    kooka->show();
    app.processEvents();
    kooka->startup();
    args->clear();

    return (app.exec());
}
Exemplo n.º 6
0
int
main(int argc, char *argv[])
{
    KCmdLineArgs::init(argc, argv, "krootimage", "kdmgreet",
                       ki18n("KRootImage"), QByteArray(),
                       ki18n("Fancy desktop background for kdm"));

    KCmdLineOptions options;
    options.add("+config", ki18n("Name of the configuration file"));
    KCmdLineArgs::addCmdLineOptions(options);

    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
    if (!args->count())
        args->usage();
    KComponentData inst(KCmdLineArgs::aboutData());
    MyApplication app(args->arg(0).toLocal8Bit(),
                      KCmdLineArgs::qtArgc(), KCmdLineArgs::qtArgv());
    args->clear();

    app.exec();
    app.flush();

    // Keep color resources after termination
    XSetCloseDownMode(QX11Info::display(), RetainTemporary);

    return 0;
}
Exemplo n.º 7
0
int Application::newInstance()
{
    KUniqueApplication::newInstance();

    // Open the basket archive or template file supplied as argument:
    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
    if (args && args->count() >= 1) {
        QString fileName = args->arg(args->count() - 1);

        if (QFile::exists(fileName)) {
            QFileInfo fileInfo(fileName);
            if (fileInfo.absoluteFilePath().contains(Global::basketsFolder())) {
                QString folder = fileInfo.absolutePath().split("/").last();
                folder.append("/");
                BNPView::s_basketToOpen = folder;
                QTimer::singleShot(100, Global::bnpView, SLOT(delayedOpenBasket()));
            } else if (!fileInfo.isDir()) { // Do not mis-interpret data-folder param!
                // Tags are not loaded until Global::bnpView::lateInit() is called.
                // It is called 0ms after the application start.
                BNPView::s_fileToOpen = fileName;
                QTimer::singleShot(100, Global::bnpView, SLOT(delayedOpenArchive()));
//              Global::bnpView->openArchive(fileName);
                args->clear();
            }
        }
    }
    return 0;
}
Exemplo n.º 8
0
int main(int argc, char **argv)
{
    KAboutData about("proptest", "KoProperty Test", version, description,
                     KAboutData::License_GPL, "(C) 2005 Cedric Pasteur", 0, 0, "*****@*****.**");
    about.addAuthor( "Cedric Pasteur", 0, "*****@*****.**" );
    KCmdLineArgs::init(argc, argv, &about);
    KCmdLineArgs::addCmdLineOptions( options );
    KApplication app;
    Test *mainWin = 0;

    if (app.isRestored())
    {
        RESTORE(Test);
    }
    else
    {
        // no session.. just start up normally
        KCmdLineArgs *args = KCmdLineArgs::parsedArgs();

        /// @todo do something with the command line args here

        mainWin = new Test();
        app.setMainWidget( mainWin );
        mainWin->show();

        args->clear();
    }

    // mainWin has WDestructiveClose flag by default, so it will delete itself.
    return app.exec();
}
Exemplo n.º 9
0
int main(int argc, char **argv)
{
  KAboutData about("KNetworkStatusTestClient", 0, ki18n("knetworkstatustestclient"), version, ki18n(description), KAboutData::License_GPL, ki18n("(C) 2007 Will Stephenson"), KLocalizedString(), 0, "*****@*****.**");
  about.addAuthor( ki18n("Will Stephenson"), KLocalizedString(), "*****@*****.**" );
  KCmdLineArgs::init(argc, argv, &about);

  KCmdLineOptions options;
  KCmdLineArgs::addCmdLineOptions(options);
  KApplication app;

  KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
  if (args->count() == 0)
  {
    TestClient *widget = new TestClient;
    widget->show();
  }
  else
  {
    int i = 0;
    for (; i < args->count(); i++)
    {
      TestClient *widget = new TestClient;
      widget->show();
    }
  }
  args->clear();

  return app.exec();
}
Exemplo n.º 10
0
int main(int argc, char *argv[])
{

	KAboutData aboutData( "kmouth", I18N_NOOP("KMouth"),
		KMOUTH_VERSION, description, KAboutData::License_GPL,
		"(c) 2002/2003, Gunnar Schmi Dt", 0, "http://www.schmi-dt.de/kmouth/index.en.html", "*****@*****.**");
	aboutData.addAuthor("Gunnar Schmi Dt",0, "*****@*****.**");
	KCmdLineArgs::init( argc, argv, &aboutData );
	KCmdLineArgs::addCmdLineOptions( options ); // Add our own options.

	aboutData.addCredit("Olaf Schmidt", I18N_NOOP("Tips, extended phrase books"), 0, 0);
  KApplication app;

  if (app.isRestored())
  {
    RESTORE(KMouthApp);
  }
  else
  {
    KMouthApp *kmouth = new KMouthApp();
    if (!kmouth->configured())
       return 0;

    kmouth->show();

    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();

		if (args->count())
		{
        kmouth->openDocumentFile(args->url(0));
		}
		args->clear();
  }
  return app.exec();
}
Exemplo n.º 11
0
int main(int argc,char **argv)
{
  KLocale::setMainCatalog( "kdepimwizards" ); 

  KAboutData aboutData( "groupwisewizard", 0,
                        ki18n( "Novell GroupWise Configuration Wizard" ),
                        "0.1" );
  KCmdLineArgs::init( argc, argv, &aboutData );

  KCmdLineOptions options;
  options.add("verbose", ki18n("Verbose output"));
  KCmdLineArgs::addCmdLineOptions( options );

  KApplication app;

  KGlobal::locale()->insertCatalog( "libkdepim" );

  KCmdLineArgs *args = KCmdLineArgs::parsedArgs();

  bool verbose = false;
  if ( args->isSet( "verbose" ) ) verbose = true;
  args->clear();
  GroupwiseWizard wizard;

  return wizard.exec();
}
Exemplo n.º 12
0
int main(int argc, char **argv)
{
  KAboutData aboutData( "ksnapshot", I18N_NOOP("KSnapshot"),
    KSNAPVERSION, description, KAboutData::License_GPL,
    "(c) 1997-2004, Richard J. Moore,\n(c) 2000, Matthias Ettrich,\n(c) 2002-2003 Aaron J. Seigo");
  aboutData.addAuthor("Richard J. Moore",0, "*****@*****.**");
  aboutData.addAuthor("Matthias Ettrich",0, "*****@*****.**");
  aboutData.addAuthor("Aaron J. Seigo", 0, "*****@*****.**");
  aboutData.addCredit( "Nadeem Hasan", I18N_NOOP("Region Grabbing\nReworked GUI"),
      "*****@*****.**" );

  KCmdLineArgs::init( argc, argv, &aboutData );
  KCmdLineArgs::addCmdLineOptions( options ); // Add our own options.
  KCmdLineArgs *args = KCmdLineArgs::parsedArgs();

  KApplication app;

  KImageIO::registerFormats();

  // Create top level window
  KSnapshot *toplevel;

  if ( args->isSet( "current" ) )
     toplevel = new KSnapshot( 0, 0, true );
  else
     toplevel = new KSnapshot();

  args->clear();
  app.dcopClient()->setDefaultObject( toplevel->objId() );
  toplevel->setCaption( app.makeStdCaption("") );
  app.setMainWidget(toplevel);
  toplevel->show();
  return app.exec();
}
Exemplo n.º 13
0
Arquivo: main.cpp Projeto: KDE/khipu
int main(int argc, char **argv)
{
    KAboutData about("khipu", "gplacs", ki18n(I18N_NOOP("Khipu")), version, ki18n(description),
                     KAboutData::License_GPL, ki18n("(C) 2010-2012, Percy Camilo Triveño Aucahuasi"));

    about.addAuthor(ki18n("Percy Camilo Triveño Aucahuasi"), ki18n("Main developer"), "*****@*****.**");

    about.addCredit(ki18n("Punit Mehta"), ki18n("GSoC-2013 student - Persistance file support. Plot-dictionary support. Worked for application actions, command-line improvements and space filtering. Several bug fixings"), "*****@*****.**");
    about.addCredit(ki18n("Manuel Álvarez Blanco"), ki18n("Thesis mentor - Guide and supervision during project conception. Bibliographical support. Numeric Mathematics and Algorithms support"), "");
    about.addCredit(ki18n("José Ignacio Cuevas Gonzáles"), ki18n("Thesis mentor - Supervision, Product Guide, Product promotion and former Client"), "*****@*****.**");
    about.addCredit(ki18n("Eduardo Fernandini Capurro"), ki18n("Thesis mentor - Supervision, Bibliographical Support, Product Guide and former Client"), "*****@*****.**");
    about.addCredit(ki18n("Jaime Urbina Pereyra"), ki18n("Thesis mentor - Supervision and former Main Project Mentor"), "*****@*****.**");

    about.addCredit(ki18n("Aleix Pol Gonzalez"), ki18n("KAlgebra and Analitza parser author, both vitals for the project"));

    about.addCredit(ki18n("José Fernando Ramos Ramirez"), ki18n("First version of Famous Curves Database. Build former windows installer"), "*****@*****.**");
    about.addCredit(ki18n("Susan Pamela Rios Sarmiento"), ki18n("First version of Famous Curves Database"), "*****@*****.**");

    about.addCredit(ki18n("Edgar Velasquez"), ki18n("2D Improvements"));
    about.addCredit(ki18n("Jose Torres Cardenas"), ki18n("3D Improvements"));
    about.addCredit(ki18n("Elizabeth Portilla Flores"), ki18n("3D Improvements"));
    about.addCredit(ki18n("Paul Murat Landauro Minaya"), ki18n("3D Improvements"));

    KCmdLineArgs::init(argc, argv, &about);

    KCmdLineOptions options;
    options.add("+[URL]", ki18n( "A Khipu-file to open" ));
    KCmdLineArgs::addCmdLineOptions(options);

    KApplication app;

    MainWindow *mainWindow = new MainWindow;

    if (app.isSessionRestored()) {
        RESTORE(MainWindow)
    } else {
        KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
        if (args->count() == 0) {
            mainWindow->checkforAutoSavedFile();
            mainWindow->show();
        } else {
            int i = 0;
            bool exit = false;
            for (; i < args->count(); i++) {
                if (i==0) {
                    if(args->arg(0)!="ignoreautosavedfile"){
                        if (!(mainWindow->openFile(args->url(0).path())))
                            exit = true;
                    }
                }
                mainWindow->show();
            }
            if (exit)
                mainWindow->deleteLater(); // can't open a khipu file, so just exit !
        }
        args->clear();
    }
    return app.exec();
}
Exemplo n.º 14
0
int main(int argc, char **argv) {
	static KCmdLineOptions options[] = {
		{"show", I18N_NOOP("Show window on startup"), 0},
		{"kwalletd", I18N_NOOP("For use by kwalletd only"), 0},
		{"+name", I18N_NOOP("A wallet name"), 0},
		KCmdLineLastOption
	};

	KAboutData about("kwalletmanager", I18N_NOOP("KDE Wallet Manager"), "1.1",
		I18N_NOOP("KDE Wallet Management Tool"),
		KAboutData::License_GPL,
		I18N_NOOP("(c) 2003,2004 George Staikos"), 0,
		"http://www.kde.org/");

	about.addAuthor("George Staikos", I18N_NOOP("Primary author and maintainer"), "*****@*****.**");
	about.addAuthor("Isaac Clerencia", I18N_NOOP("Developer"), "*****@*****.**");

	KCmdLineArgs::init(argc, argv, &about);
	KCmdLineArgs::addCmdLineOptions(options);

	if (!KUniqueApplication::start()) {
		return 0;
	}

	MyApp a;

	KWalletManager wm;
	wm.setCaption(i18n("KDE Wallet Manager"));

	a.setMainWidget(&wm);

	KGlobal::dirs()->addResourceType("kwallet", "share/apps/kwallet");

	KCmdLineArgs *args = KCmdLineArgs::parsedArgs();

	if (args->isSet("show")) {
		wm.show();
	}

	if (args->isSet("kwalletd")) {
		wm.kwalletdLaunch();
	}

	for (int i = 0; i < args->count(); ++i) {
		QString fn = QFileInfo(args->arg(i)).absFilePath();
		KMimeType::Ptr ptr;
		if (QFile::exists(fn) &&
			(ptr = KMimeType::findByFileContent(fn)) &&
			ptr->is("application/x-kde-wallet")) {
			wm.openWalletFile(fn);
		} else {
			wm.openWallet(args->arg(i));
		}
	}
	args->clear();
	return a.exec();
}
Exemplo n.º 15
0
 StartHelper()
     : mFullScreen(false)
     , mSlideShow(false) {
     KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
     if (args->count() > 0) {
         parseArgs(args);
     }
     args->clear();
 }
Exemplo n.º 16
0
int main(int argc, char **argv)
{
  KAboutData aboutData( "ksnapshot", 0, ki18n("KSnapshot"),
    KSNAPVERSION, ki18n(description), KAboutData::License_GPL,
    ki18n("(c) 1997-2008, Richard J. Moore,\n(c) 2000, Matthias Ettrich,\n(c) 2002-2003 Aaron J. Seigo"));
  aboutData.addAuthor(ki18n("Richard J. Moore"),KLocalizedString(), "*****@*****.**");
  aboutData.addAuthor(ki18n("Matthias Ettrich"),KLocalizedString(), "*****@*****.**");
  aboutData.addAuthor(ki18n("Aaron J. Seigo"), KLocalizedString(), "*****@*****.**");
  aboutData.addCredit( ki18n("Nadeem Hasan"), ki18n("Region Grabbing\nReworked GUI"),
      "*****@*****.**" );
  aboutData.addCredit( ki18n("Marcus Hufgard"), ki18n("\"Open With\" function"),
      "*****@*****.**" );
  aboutData.addCredit( ki18n("Pau Garcia i Quiles"), ki18n("Free region grabbing, KIPI plugins support, port to Windows"),
      "*****@*****.**" );

  KCmdLineArgs::init( argc, argv, &aboutData );
  KCmdLineArgs::addCmdLineOptions( ksnapshot_options() ); // Add our own options.
  KCmdLineArgs *args = KCmdLineArgs::parsedArgs();

  // This is one of the applications that requires the "native" / X11 graphics backend to work.
  QApplication::setGraphicsSystem("native");
  KApplication app;

  // Create top level window
  KSnapshot *toplevel;
  bool showTopLevel = false;

  if ( args->isSet( "current" ) )
     toplevel = new KSnapshot( 0, KSnapshotObject::WindowUnderCursor );
  else if(args->isSet( "fullscreen" ))
  {
     //we grad directly desktop => show dialogbox
     showTopLevel = true;
     toplevel = new KSnapshot( 0, KSnapshotObject::FullScreen );
  }
  else if(args->isSet( "region" ))
     toplevel = new KSnapshot( 0, KSnapshotObject::Region );
  else if(args->isSet( "freeregion" ))
     toplevel = new KSnapshot( 0, KSnapshotObject::FreeRegion );
  else if(args->isSet( "child" ))
     toplevel = new KSnapshot( 0, KSnapshotObject::ChildWindow );
  else
  {
     showTopLevel = true;
     toplevel = new KSnapshot();
  }

  args->clear();
  new KsnapshotAdaptor(toplevel);
  QDBusConnection::sessionBus().registerObject("/KSnapshot", toplevel);

  if(showTopLevel)
     toplevel->show();
  return app.exec();
}
Exemplo n.º 17
0
int main ( int argc, char **argv ) {
  KAboutData about ( "kmilion", 0, ki18n ( "KMilion" ), version, ki18n ( description ),
                     KAboutData::License_GPL, ki18n ( "(C) 2010 Mikołaj Sochacki" ), KLocalizedString(), 0, "*****@*****.**" );
  about.addAuthor ( ki18n ( "Mikołaj Sochacki" ), KLocalizedString(), "*****@*****.**" );
  KCmdLineArgs::init ( argc, argv, &about );

  KCmdLineOptions options;
  options.add ( "+[URL]", ki18n ( "Document to open" ) );
  KCmdLineArgs::addCmdLineOptions ( options );
  KApplication app;
  
  KMilion *widget = new KMilion;
  const QRect r = app.desktop()->frameGeometry();
  widget->setScreenSize ( r.width(), r.height() );
  KCmdLineArgs *args;
  if ( app.isSessionRestored() ) {
      RESTORE ( KMilion );
    }
  else {
      args = KCmdLineArgs::parsedArgs();
      widget->show();
    }
  args->clear();

  // Tak jest w orginale nie mam pojęcia dlaczego? Szczególnie po co kilka razy show!
  //see if we are starting with session management
//     if (app.isSessionRestored())
//     {
//         RESTORE(KMilion);
//     }
//     else
//     {
//         // no session.. just start up normally
//         KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
//         if (args->count() == 0)
//         {
//             //kmilion *widget = new kmilion;
//             widget->show();
//         }
//         else
//         {
//             int i = 0;
//             for (; i < args->count(); i++)
//             {
//                 //kmilion *widget = new kmilion;
//                 widget->show();
//             }
//         }
//         args->clear();
//     }

  return app.exec();
}
Exemplo n.º 18
0
int main(int argc, char *argv[])
{

    KAboutData aboutData( "kimagemapeditor", I18N_NOOP("KImageMapEditor"),
                          VERSION, description, KAboutData::License_GPL,
                          "(C) 2001-2008 Jan Schaefer", 0, "http://www.nongnu.org/kimagemap/", "*****@*****.**");
    aboutData.addAuthor("Jan Schaefer",0, "*****@*****.**");
    aboutData.addCredit("Joerg Jaspert",I18N_NOOP("For helping me with the Makefiles, and creating the Debian package"));
    aboutData.addCredit("Aaron Seigo and Michael",I18N_NOOP("For helping me fixing --enable-final mode"));
    aboutData.addCredit("Antonio Crevillen",I18N_NOOP("For the Spanish translation"));
    aboutData.addCredit("Fabrice Mous",I18N_NOOP("For the Dutch translation"));
    aboutData.addCredit("Germain Chazot",I18N_NOOP("For the French translation"));
    KCmdLineArgs::init( argc, argv, &aboutData );
    KCmdLineArgs::addCmdLineOptions( options ); // Add our own options.

    KApplication a;
    a.dcopClient()->registerAs(a.name());



    if (a.isRestored())
    {
        RESTORE(KimeShell);
    }
    else
    {
        KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
        if ( args->count() == 0 )
        {
            KimeShell *kimeShell = new KimeShell();
            kimeShell->setStdout(args->isSet("stdout"));
            kimeShell->readConfig();
            kimeShell->show();
            kimeShell->openLastFile();
        }
        else
        {
            int i = 0;
            for (; i < args->count(); i++ )
            {
                KimeShell *kimeShell = new KimeShell();
                kimeShell->setStdout(args->isSet("stdout"));
                kimeShell->readConfig();
                kimeShell->show();
                kimeShell->openFile(args->url(i));
            }
        }
        args->clear();
    }

    return a.exec();
}
Exemplo n.º 19
0
int main(int argc, char** argv)
{
    qInstallMsgHandler(messageOutput);
    KAboutData aboutData( "duchaintokross", 0, ki18n( "duchaintokross" ),
                          "33", ki18n("Wrapper generator from C++ to Kross"), KAboutData::License_GPL,
                          ki18n( "(c) 2008, The KDevelop developers" ), KLocalizedString(), "http://www.kdevelop.org" );
    KCmdLineArgs::init( argc, argv, &aboutData );
    KCmdLineOptions options;
    options.add("+file", ki18n("input .cpp file"), QByteArray());
    options.add("I <includes>", ki18n("include directories for the parser (colon separated)"), QByteArray());
    options.add("i <includes>", ki18n("include directories that the generated implementation file will have (colon separated)"), QByteArray());
    options.add("b <builddir>", ki18n("build dir where the Makefile for the input is added"), QByteArray());
    options.add("F <filename>", ki18n("filename to be used for the .moc and the .h file"), QByteArray());
    options.add("D <directory>", ki18n("directory where to put the .h output"), QByteArray());
    options.add("o <output>", ki18n("directory where to put the code output"), QByteArray());
    options.add("impl", ki18n("create implementation"), QByteArray());
    options.add("verbose", ki18n("Verbose output"), QByteArray());
    KCmdLineArgs::addCmdLineOptions( options );
    
    KApplication app;
    ConsoleIDEExtension::init();
    Core::initialize(0, Core::NoUi);
    
    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
    KUrl::List includes;
    KUrl input;
    
    for(int i=0; i<args->count(); i++)
    {
        QString arg=args->arg(i);
        input=KUrl(arg);
    }
    
    foreach(const QString& inc, args->getOption("I").split(':'))
        includes << KUrl(inc);
    KUrl builddir(args->getOption("b"));
    QString filename(args->getOption("F"));
    QString directory(args->getOption("D"));
    QStringList toinclude(args->getOption("i").split(':'));
    QString output(args->getOption("o"));
    verbose=args->isSet("verbose");
    bool createImpl=args->isSet("impl");
    args->clear();
    
    DUChainExtractor e;
    kDebug() << input << builddir << includes << toinclude;
    e.setWriteImpl(createImpl);
    e.start(input, builddir, includes, filename, directory, toinclude, output);
    
    return app.exec();
}
Exemplo n.º 20
0
extern "C" KDE_EXPORT int kdemain (int argc, char *argv[]) {
    setsid ();

    KAboutData aboutData ("kmplayer", 0, ki18n("KMPlayer"),
            KMPLAYER_VERSION_STRING,
            ki18n ("Media player."),
            KAboutData::License_GPL,
            ki18n ("(c) 2002-2009, Koos Vriezen"),
            KLocalizedString(),
            I18N_NOOP ("http://kmplayer.kde.org"));
    aboutData.addAuthor(ki18n("Koos Vriezen"), ki18n("Maintainer"),"*****@*****.**");
    KCmdLineArgs::init (argc, argv, &aboutData);
    KCmdLineOptions options;
    options.add ("+[File]", ki18n ("file to open"));
    KCmdLineArgs::addCmdLineOptions (options);

    KMPlayer::Ids::init();

    KApplication app;
    QPointer <KMPlayerApp> kmplayer;

    if (app.isSessionRestored ()) {
        RESTORE (KMPlayerApp);
    } else {
        kmplayer = new KMPlayerApp ();
        kmplayer->show();

        KCmdLineArgs *args = KCmdLineArgs::parsedArgs();

        KUrl url;
        if (args->count () == 1)
            url = args->url (0);
        if (args->count () > 1)
            for (int i = 0; i < args->count (); i++) {
                KUrl url = args->url (i);
                if (url.url ().indexOf ("://") < 0)
                    url = KUrl (QFileInfo (url.url ()).absoluteFilePath ());
                if (url.isValid ())
                    kmplayer->addUrl (url);
            }
        kmplayer->openDocumentFile (url);
        args->clear ();
    }
    int retvalue = app.exec ();

    delete kmplayer;

    KMPlayer::Ids::reset();

    return retvalue;
}
Exemplo n.º 21
0
int main(int argc, char *argv[]) {
	KAboutData aboutData( "rkward", I18N_NOOP ("RKWard"), version, description, KAboutData::License_GPL, "(c) 2002, 2004, 2005, 2006", 0, "http://rkward.sf.net", "*****@*****.**");
	aboutData.addAuthor ("Thomas Friedrichsmeier", I18N_NOOP ("Project leader / main developer"), 0);
	aboutData.addAuthor ("Pierre Ecochard",  I18N_NOOP ("C++ coder since 0.2.9"), 0);
	aboutData.addCredit ("Contributors in alphabetical order", 0, 0);
	aboutData.addCredit ("Philippe Grosjean", I18N_NOOP ("Several helpful comments and discussions"), 0);
	aboutData.addCredit ("Adrien d'Hardemare", I18N_NOOP ("Plugins and patches"), 0);
	aboutData.addCredit ("Yves Jacolin", I18N_NOOP ("New website"), 0);
	aboutData.addCredit ("Prasenjit Kapat", I18N_NOOP ("Several plugins"), 0);
	aboutData.addCredit ("Marco Martin", I18N_NOOP ("A cool icon"), 0);
	aboutData.addCredit ("Daniele Medri", I18N_NOOP ("RKWard logo, many suggestions, help on wording"), 0);
	aboutData.addCredit ("Stefan Roediger", I18N_NOOP ("Many plugins, suggestions, marketing, translations"), 0);
	aboutData.addCredit ("David Sibai", I18N_NOOP ("Several valuable comments, hints and patches"), 0);
	aboutData.addCredit ("Ilias Soumpasis", I18N_NOOP ("Translation, Suggestions, plugins"), 0);
	aboutData.addCredit ("Ralf Tautenhahn", I18N_NOOP ("Many comments, useful suggestions, and bug reports"), 0);
	aboutData.addCredit ("Roland Vollgraf", I18N_NOOP ("Some patches"), 0);
	aboutData.addCredit (I18N_NOOP ("Many more people on [email protected]"), I18N_NOOP ("Sorry, if we forgot to list you. Please contact us to get added"), 0);

	// before initializing the commandline args, remove the ".bin" from "rkward.bin".
	// This is so it prints "Usage rkward..." instead of "Usage rkward.bin...", etc.
	// it seems safest to keep a copy, since the shell still owns argv[0]
	char *argv_zero_copy = argv[0];
	argv[0] = qstrdup (QString (argv_zero_copy).remove (".bin").local8Bit ());
	KCmdLineArgs::init( argc, argv, &aboutData );
	KCmdLineArgs::addCmdLineOptions( options ); // Add our own options.
	
	RKWardApplication app;
	if (app.isRestored ()) {
		RESTORE(RKWardMainWindow);	// well, whatever this is supposed to do -> TODO
	} else {
		KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
		RK_Debug_Level = 5 - QString (args->getOption ("debug-level")).toInt ();
		RK_Debug_Flags = QString (args->getOption ("debug-flags")).toInt (0, 2);
		qDebug ("Debug-flags as decimal: %d", RK_Debug_Flags);
		
		KURL *open_url = 0;
		if (args->count ()) {
			open_url = new KURL (args->makeURL (args->arg (0)));
		}
		args->clear();
		
		new RKWardMainWindow(open_url);
	}

	// do it!
	int status = app.exec ();
	// restore old argv[0] so the shell is happy
	argv[0] = argv_zero_copy;
	return status;
}
Exemplo n.º 22
0
 virtual int newInstance()
 {
    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
    if (args->count() > 0)
    {
        menuEdit->selectMenu(args->arg(0));
        if (args->count() > 1)
        {
            menuEdit->selectMenuEntry(args->arg(1));
        }
    }
    args->clear();
    return KUniqueApplication::newInstance();
 }
Exemplo n.º 23
0
int main(int argc, char **argv)
{
    KAboutData about("moviemanager", 0, ki18n("MovieManager"), version, ki18n(description),
                     KAboutData::License_GPL, ki18n("(C) 2012 Sandeep Raju P & Sadan Sohan M"), KLocalizedString(), 0, "[email protected]\[email protected]");
    about.addAuthor( ki18n("Sandeep Raju P"), KLocalizedString(), "*****@*****.**" );
    about.addAuthor( ki18n("Sadan Sohan M"), KLocalizedString(), "*****@*****.**" );
    KCmdLineArgs::init(argc, argv, &about);

    KCmdLineOptions options;
    options.add("+[URL]", ki18n( "Document to open" ));
    KCmdLineArgs::addCmdLineOptions(options);
    KApplication app;

    MovieManager *widget = new MovieManager();

    // see if we are starting with session management
    if (app.isSessionRestored())
    {
        RESTORE(MovieManager);
    }
    else
    {
        // no session.. just start up normally
        KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
        if (args->count() == 0)
        {
            //moviemanager *widget = new moviemanager;
            //widget->setMaximumSize(200,200);
            widget->show();
            //mainListScroll->show();
           // widget->mainListScroll->show();

        }
        else
        {
            int i = 0;
            for (; i < args->count(); i++)
            {
                //moviemanager *widget = new moviemanager;
                //widget->setMaximumSize(200,200);
                widget->show();
                //widget->mainListScroll->show();
            }
        }
        args->clear();
    }

    return app.exec();
}
Exemplo n.º 24
0
int main(int argc, char** argv) {

    KAboutData about("kphotobook", I18N_NOOP("KPhotoBook"), version, description,
                     KAboutData::License_GPL, "(C) 2003 Michael Christen",
                     0, // free text, can contain new lines
                     "http://kphotobook.sourceforge.net",
                     "*****@*****.**");
    about.addAuthor("Michael Christen", "The master chief developer.", "*****@*****.**" );
    about.addAuthor("Thomas Christen", "One of Santa's greater helpers.\nHelps me creating icons and writing the website and the documentation.", "*****@*****.**");
    about.addAuthor("Stefan Fink", "One of Santa's little helpers.\nAdvises in design and usability questions.");
    about.addAuthor("Daniel Gerber", "One of Santa's little helpers.\nAdvises in design and usability questions.");

    about.addCredit("George W. Bush, President of the USA", "For being a stupid little git.", "*****@*****.**" );

    KCmdLineArgs::init(argc, argv, &about);
    KCmdLineArgs::addCmdLineOptions(options);

    KApplication app;

    KMdi::MdiMode mdiMode = KMdi::IDEAlMode;
    if (Settings::generalViewMode() == Settings::EnumGeneralViewMode::TabPageMode) {
        mdiMode = KMdi::TabPageMode;
    }

    KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
    if (args->count() == 0) {

        KPhotoBook* widget = new KPhotoBook(mdiMode);
        widget->show();

        // try to load last opened file
        QString lastFileName = Settings::fileSystemLastOpenedFile();
        if (!lastFileName.isEmpty()) {
            QFileInfo lastFile(lastFileName);
            widget->load(lastFile);
        }
    } else {
        int i = 0;
        for (; i < args->count(); i++) {
            QFileInfo file(args->url(i).path());
            KPhotoBook* widget = new KPhotoBook(mdiMode);
            widget->show();
            widget->load(file);
        }
    }
    args->clear();

    return app.exec();
}
Exemplo n.º 25
0
int main(int argc, char **argv)
{

    QDate date;
    QString calType, option;

    KAboutData aboutData("kcalendartest", "KCalendarTest", "0.1", description, KAboutData::License_GPL, "(c) 2002, Carlos Moro", 0, 0,
                         "*****@*****.**");
    aboutData.addAuthor("Carlos Moro", 0, "*****@*****.**");


    KCmdLineArgs::init(argc, argv, &aboutData);
    KCmdLineArgs::addCmdLineOptions(options); // Add our own options.

    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();

    KApplication app(false, false);

    QStringList lst = KCalendarSystemFactory::calendarSystems();
    kdDebug() << "Supported calendar types: " << endl;
    for(QStringList::Iterator it = lst.begin(); it != lst.end(); ++it)
        kdDebug() << *it << endl;
    kdDebug() << endl;


    if(args->isSet("type"))
        calType = args->getOption("type");


    KGlobal::locale()->setCalendar(calType);

    /*
     *  If we like to see some date
     *
     */
    if(args->isSet("date"))
    {
        option = args->getOption("date");
        date = KGlobal::locale()->readDate(option);
    }
    else
        date = QDate::currentDate();

    args->clear(); // Free up some memory.

    test(date);

    return 0;
}
Exemplo n.º 26
0
int main(int argc, char **argv)
{
	 KLocale::setMainCatalogue("kasablanca");	

    KAboutData about("kasablanca", I18N_NOOP("kasablanca"), version, description,
                     KAboutData::License_GPL, "(C) 2004 Magnus Kulke", 0, 0,
							"*****@*****.**");
    about.addAuthor( "Magnus Kulke", 0, "*****@*****.**" );
    about.addAuthor( "Big Biff", 0, "*****@*****.**" );
	 about.addCredit( "Stefan Bogner", 0, "*****@*****.**" );
	 about.addCredit( "Christoph Thielecke", 0, "*****@*****.**" );
	about.addCredit( "Richard Stellingwerf", 0, "*****@*****.**" );
    KCmdLineArgs::init(argc, argv, &about);
    KCmdLineArgs::addCmdLineOptions(options);
    KApplication app;

    // register ourselves as a dcop client
    app.dcopClient()->registerAs(app.name(), false);

    // see if we are starting with session management
    if (app.isRestored())
    {
        RESTORE(Kasablanca);
    }
    else
    {
        // no session.. just start up normally
        KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
        if (args->count() == 0)
        {
            Kasablanca *widget = new Kasablanca;
            widget->show();
        }
        else
        {
            int i = 0;
            for (; i < args->count(); i++)
            {
                Kasablanca *widget = new Kasablanca;
                widget->show();
// TODO: Load the ftp url passed on the command line.
//                widget->load(args->url(i));
            }
        }
        args->clear();
    }

    return app.exec();
}
Exemplo n.º 27
0
int main(int argc, char *argv[])
{
  for (int i = 0; i < argc; i++)
  {
    qDebug("argv[%d] = %s", i, argv[i]);
  }
  KAboutData aboutData( "testqtargs", 0, ki18n("testqtargs"),
    "1.0", ki18n("testqtargs"), KAboutData::License_GPL);
	
  KCmdLineOptions options;
  options.add("hello ", ki18n("Says hello"));

  KCmdLineArgs::init(argc, argv, &aboutData);
  KCmdLineArgs::addCmdLineOptions(options);

  KCmdLineArgs *qtargs = KCmdLineArgs::parsedArgs("qt");
  for (int i = 0; i < qtargs->count(); i++)
  {
    qDebug("qt arg[%d] = %s", i, qtargs->arg(i).toLocal8Bit().data());
  }

  KApplication app;

  KCmdLineArgs *kdeargs = KCmdLineArgs::parsedArgs("kde");
  KCmdLineArgs *args = KCmdLineArgs::parsedArgs();

  // An arg set by Qt
  if(qtargs->isSet("background"))
  {
    qDebug("arg bg = %s", qtargs->getOption("background").toLocal8Bit().data());
  }
  // An arg set by KDE
  if(kdeargs->isSet("caption"))
  {
    qDebug("arg caption = %s", kdeargs->getOption("caption").toLocal8Bit().data());
  }
  // An arg set by us.
  if(args->isSet("hello"))
  {
    qDebug("arg hello = %s", args->getOption("hello").toLocal8Bit().data());
  }
  args->clear();

  QWidget *w = new QWidget();
  w->show();

  return app.exec();
}
Exemplo n.º 28
0
int main(int argc, char **argv)
{
    KAboutData about("ktouch",
                     I18N_NOOP("KTouch"),
                     version,
                     description,
                     KAboutData::License_GPL,
                     "Copyright (C) 2000-2006 by Håvard Frøiland and Andreas Nicolai",
                     0,
                     "http://edu.kde.org/ktouch",
                     "*****@*****.**");
    about.addAuthor( "Andreas Nicolai", I18N_NOOP("Current maintainer and programmer"), "*****@*****.**" );
    about.addAuthor( "Håvard Frøiland", I18N_NOOP("Original author, project admin"), "*****@*****.**" );
    about.addCredit( "David Vignoni", I18N_NOOP("Creator of the SVG icon"), "*****@*****.**");
    about.addCredit( "Anne-Marie Mahfouf", I18N_NOOP("Lots of patches, fixes, updates"), "*****@*****.**");
    about.addCredit( "All the creators of training and keyboard files", 0, 0);
    KCmdLineArgs::init(argc, argv, &about);
    KCmdLineArgs::addCmdLineOptions( options );
    KApplication app;
    KTouch *mainWin = 0;

    if (app.isRestored()) {
        RESTORE(KTouch);
    }
    else
    {
        // no session.. just start up normally
        KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
        // TODO: check the command line for a training file and set this as the new to open training file

        /* TODO: turn splash screen on in release
        KTouchSplash splash;            // create the splash screen
        splash.setHideEnabled( true );  // allow user to click the splash screen away
        splash.show();                  // show it
        QTimer splashTimer;
        splashTimer.connect(&splashTimer, SIGNAL(timeout()), &splash, SLOT(hide()));
        splashTimer.start(2000, true);  // start singleshot timer to hide the splashscreen
        */

        mainWin = new KTouch();
        app.setMainWidget( mainWin );

        mainWin->show();
        args->clear();
    }

    return app.exec();
}
Exemplo n.º 29
0
int
main (int argc, char **argv)
{
  KAboutData aboutData("ksokoban", 0, ki18n("KSokoban"),
		       version, ki18n(description), KAboutData::License_GPL,
		       ki18n("(c) 1998-2001  Anders Widell"), KLocalizedString(),
		       "http://hem.passagen.se/awl/ksokoban/");
  aboutData.addAuthor(ki18n("Anders Widell"), KLocalizedString(),
		      "*****@*****.**",
		      "http://hem.passagen.se/awl/");
  aboutData.addCredit(ki18n("David W. Skinner"),
		      ki18n("For contributing the Sokoban levels included in this game"),
		      "*****@*****.**",
		      "http://users.bentonrea.com/~sasquatch/");
  KCmdLineArgs::init(argc, argv, &aboutData);

  KCmdLineOptions options;
  options.add("+[file]", ki18n("Level collection file to load"));
  KCmdLineArgs::addCmdLineOptions(options);
//   KUniqueApplication::addCmdLineOptions();

//   if (!KUniqueApplication::start())
//     return 0;

  QApplication::setColorSpec(QApplication::ManyColor);

//   KUniqueApplication app;
  KApplication app;
//

  MainWindow *widget = new MainWindow();
  widget->show();

  KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
  if (args->count() > 0) {
    widget->openUrl(args->url(0));
  }
  args->clear();

  QObject::connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()));

  int rc = app.exec();

//   delete widget;

  return rc;
}
Exemplo n.º 30
0
int main(int argc, char **argv)
{
    KAboutData about("d3lphin",
                     I18N_NOOP("Dolphin"),
                     "0.9.2",
                     I18N_NOOP("File Manager"),
                     KAboutData::License_GPL,
                     "(C) 2007 Marcel Juhnke");
    about.setHomepage("https://marrat.homelinux.org/D3lphin");
    about.setBugAddress("*****@*****.**");
    about.addAuthor("Marcel Juhnke", I18N_NOOP("Maintainer and developer"), "*****@*****.**");
    about.addAuthor("Michael Austin", I18N_NOOP("Documentation"), "*****@*****.**");
    about.addAuthor("Orville Bennett", I18N_NOOP("Documentation"), "*****@*****.**");
    about.addCredit("Peter Penz", I18N_NOOP("... for the great original Dolphin"));
    about.addCredit("Cvetoslav Ludmiloff, Stefan Monov", I18N_NOOP("... for their development on the original Dolphin"));
    about.addCredit("Aaron J. Seigo", I18N_NOOP("... for the great support and the amazing patches for the orignal Dolphin"));
    about.addCredit("Patrice Tremblay, Gregor Kalisnik, Filip Brcic, Igor Stepin and Jan Mette", I18N_NOOP("... for their patches"));
    about.addCredit("Ain, Itai, Ivan, Jannick, Stephane, Patrice, Piotr, Stefano and Power On",
                    I18N_NOOP("... for their translations"));

    KCmdLineArgs::init(argc, argv, &about);
    KCmdLineArgs::addCmdLineOptions(options);

    KApplication app;
    Dolphin& mainWin = Dolphin::mainWin();
    mainWin.show();

    if (app.isRestored()) {
        int n = 1;
        while (KMainWindow::canBeRestored(n)){
            Dolphin::mainWin().restore(n);
            ++n;
        }
    } else {
        KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
        if (args->count() > 0) {
            mainWin.activeView()->setURL(args->url(0));

            for (int i = 1; i < args->count(); ++i) {
                KRun::run("d3lphin", args->url(i));
            }
        }
        args->clear();
    }

    return app.exec();
}