Ejemplo n.º 1
0
int main(int argc, char *argv[])
{
	KAboutData aboutData( 	"qCheckGMail",
				0,
				ki18n( "qCheckGMail" ),
				"1.0.0",
				ki18n( "a qt based gmail checker" ),
				KAboutData::License_GPL_V2,
				ki18n( "(c)2013,ink Francis\nemail:[email protected]" ),
				ki18n( "*****@*****.**" ),
				"(c)2013,ink Francis\nemail:[email protected]",
				"https://github.com/mhogomchungu/qCheckGMail/issues" );

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

	KCmdLineOptions options;
	options.add( "a",ki18n( "auto start application" ) ) ;
	KCmdLineArgs::addCmdLineOptions( options ) ;
	KUniqueApplication::addCmdLineOptions();

	if( KCmdLineArgs::allArguments().contains( "-a" ) ){
		if( configurationoptionsdialog::autoStartEnabled() ){
			return startApp() ;
		}else{
			return qCheckGMail::autoStartDisabled() ;
		}
	}else{
		return startApp() ;
	}
}
Ejemplo n.º 2
0
int main(int argc, char *argv[])
{
    KAboutData aboutData(
        "gwenview",        /* appname */
        0,                 /* catalogName */
        ki18n("Gwenview"), /* programName */
        GWENVIEW_VERSION); /* version */
    aboutData.setShortDescription(ki18n("An Image Viewer"));
    aboutData.setLicense(KAboutData::License_GPL);
    aboutData.setCopyrightStatement(ki18n("Copyright 2000-2010 Aurélien Gâteau"));
    aboutData.addAuthor(
        ki18n("Aurélien Gâteau"),
        ki18n("Main developer"),
        "*****@*****.**");

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

    KCmdLineOptions options;
    options.add("f", ki18n("Start in fullscreen mode"));
    options.add("s", ki18n("Start in slideshow mode"));
    options.add("+[file or folder]", ki18n("A starting file or folder"));
    KCmdLineArgs::addCmdLineOptions(options);

    KApplication app;
    Gwenview::ImageFormats::registerPlugins();

    // startHelper must live for the whole live of the application
    StartHelper startHelper;
    if (app.isSessionRestored()) {
        kRestoreMainWindows<Gwenview::MainWindow>();
    } else {
        startHelper.createMainWindow();
    }
    return app.exec();
}
Ejemplo n.º 3
0
int main(int argc, char **argv)
{
    KAboutData about("khotnewstuff", 0, ki18n("KHotNewStuff"), "0.4");
    about.setProgramIconName("get-hot-new-stuff");
    KCmdLineArgs *args;

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

    KCmdLineOptions op;
    op.add("+filename", ki18n("Name of .knsrc file to use"));
    op.add("+filename", ki18n("Name of file to upload"));
    KCmdLineArgs::addCmdLineOptions(op);
    args = KCmdLineArgs::parsedArgs();

    KApplication i;
    
    if (args->count() > 0) {
        KNS3::UploadDialog dialog(args->arg(0));
        if (args->count() > 1) {
            dialog.setUploadFile(KUrl(args->arg(1)));
        }
        dialog.exec();
    }
    else
    {
        args->usage();
        return -1;
    }
    return 0;
}
Ejemplo n.º 4
0
int main(int argc, char **argv)
{
    KCmdLineArgs::init(argc, argv, &aboutData);

    KCmdLineOptions options;
    options.add("embed <winid>", ki18n("Makes the dialog transient for an X app specified by winid"));
    options.add("+[URL]", ki18n("URL to install"));
    KCmdLineArgs::addCmdLineOptions(options);

    QSet<KUrl>   urls;
    KCmdLineArgs *args(KCmdLineArgs::parsedArgs());

    for(int i=0; i < args->count(); i++)
        urls.insert(args->url(i));

    if(urls.count())
    {

        KApplication    app;
        QString         opt(args->getOption("embed"));
        KFI::CInstaller inst(createParent(opt.size() ? opt.toInt(0, 16) : 0));

        return inst.install(urls);
    }

    return -1;
}
Ejemplo n.º 5
0
int main(int argc, char** argv)
{
	qsrand(time(0));
	KAboutData about("palapeli", 0, ki18nc("The application's name", "Palapeli"), "2.0", ki18n("KDE Jigsaw Puzzle Game"), KAboutData::License_GPL, ki18n("Copyright 2009, 2010, Stefan Majewsky"));
	about.addAuthor(ki18n("Stefan Majewsky"), KLocalizedString(), "*****@*****.**", "http://majewsky.wordpress.com");
	about.addCredit (ki18n ("Johannes Loehnert"),
			 ki18n ("The option to preview the completed puzzle"),
			 "*****@*****.**");
	about.setHomepage("https://www.kde.org/applications/games/palapeli/");
	KCmdLineArgs::init(argc, argv, &about);

	KCmdLineOptions options;
	options.add("+puzzlefile", ki18n("Path to puzzle file (will be opened if -i is not given)"));
	options.add("i").add("import", ki18n("Import the given puzzle file into the local collection (does nothing if no puzzle file is given)"));
	options.add("", ki18n("If the -i/--import option is specified, the main window will not be shown after importing the given puzzle."));
	KCmdLineArgs::addCmdLineOptions(options);

	KApplication app;

	KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
	//NOTE: Syntax errors are reported on stderr, while file errors are presented to the user.
	if (args->isSet("import"))
		//perform import request
		new Palapeli::ImportHelper(args);
	else
		//no import request, show main window
		(new Palapeli::MainWindow(args))->show();
	return app.exec();
}
Ejemplo n.º 6
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();
}
Ejemplo n.º 7
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();
}
Ejemplo n.º 8
0
extern "C" KDE_EXPORT int kdemain( int argc, char* argv[] )
{
    KCmdLineArgs::init( argc, argv, KarbonFactory::aboutData() );

    KCmdLineOptions options;
    options.add("+[file]", ki18n( "File to open" ));
    KCmdLineArgs::addCmdLineOptions( options );

    KoApplication app(KARBON_MIME_TYPE);

#ifdef MAINTANER_WANTED_SPLASH
    // After creating the KApplication then create the pixmap from an xpm: we cannot get the
    // location of our datadir before we've started our components,
    // so use an xpm.
    QSplashScreen *splashScreen = new KoSplashScreen(QPixmap(splash_screen_xpm));
    splashScreen->show();
    splashScreen->showMessage("<p style=\"color:black\">"
    "<b>Calligra Karbon is unmaintained!</b><br><br>"
    "The Calligra community welcomes someone to take over.<br><br>"
    "See community.kde.org/Calligra</p>");
#endif

    if( !app.start() )  // parses command line args, create initial docs and mainwindows
        return 1;

    return app.exec();
}
Ejemplo n.º 9
0
int main(int argc, char* argv[])
{
    PLEAboutData aboutData;
    aboutData.setAppName("photolayoutseditor");
    aboutData.setCatalogName("kipiplugin_photolayoutseditor");

    KCmdLineArgs::init(argc,argv,&aboutData);
    KCmdLineOptions options;
    options.add("+file", ki18n("Input file"));
    KCmdLineArgs::addCmdLineOptions(options);

    KApplication app;
    aboutData.setProgramLogo(KIcon("photolayoutseditor"));

    PhotoLayoutsEditor* w = PhotoLayoutsEditor::instance(0);
    w->setAttribute(Qt::WA_DeleteOnClose, true);

    KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
    if (args->count())
    {
        KUrl url = args->url(0);
        if (url.isValid())
            w->open(url);
    }

    w->show();

    int result = app.exec();

    return result;
}
Ejemplo n.º 10
0
int main(int argc, char *argv[])
{
    QScopedPointer<KAboutData> aboutData(
        Gwenview::createAboutData(
            "gwenview",       /* appname */
            0,                /* catalogName */
            ki18n("Gwenview") /* programName */
        ));
    aboutData->setShortDescription(ki18n("An Image Viewer"));

    KCmdLineArgs::init(argc, argv, aboutData.data());

    KCmdLineOptions options;
    options.add("f", ki18n("Start in fullscreen mode"));
    options.add("s", ki18n("Start in slideshow mode"));
    options.add("+[file or folder]", ki18n("A starting file or folder"));
    KCmdLineArgs::addCmdLineOptions(options);

    KApplication app;
    Gwenview::ImageFormats::registerPlugins();

    // startHelper must live for the whole life of the application
    StartHelper startHelper;
    if (app.isSessionRestored()) {
        kRestoreMainWindows<Gwenview::MainWindow>();
    } else {
        startHelper.createMainWindow();
    }
    return app.exec();
}
Ejemplo n.º 11
0
int main(int argc, char **argv)
{
    KAboutData aboutData( "husky_test", "husky_test",
        ki18n("husky_test"), "0.1",
        ki18n("test."),
        KAboutData::License_GPL,
        ki18n("Copyright (c) 2013") );

    KCmdLineArgs::init( argc, argv, &aboutData );
    KCmdLineOptions options;
    options.add("+[file]", ki18n("demo argument"));
    KCmdLineArgs::addCmdLineOptions(options);
 
    // parse command line arguments
    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
    if(args->count()) {
        std::cout << "have args " << args->count() << std::endl;
    }

    KApplication app;

    Mainwin *p = new Mainwin;
    p->show();

    return app.exec();
}
Ejemplo n.º 12
0
int main( int argc, char **argv )
{
  KAboutData aboutData( "testkabcdlg", 0, ki18n( "TestKabc" ), "0.1" );
  KCmdLineArgs::init( argc, argv, &aboutData );

  KCmdLineOptions options;
  options.add( "multiple", ki18n( "Allow selection of multiple addressees" ) );
  KCmdLineArgs::addCmdLineOptions( options );

  KApplication app;

  KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
  if ( args->isSet( "multiple" ) ) {
    Addressee::List al = AddresseeDialog::getAddressees( 0 );
    Addressee::List::ConstIterator it;
    kDebug() << "Selected Addressees:";
    for ( it = al.constBegin(); it != al.constEnd(); ++it ) {
      kDebug() << "  " << ( *it ).fullEmail();
    }
  } else {
    Addressee a = AddresseeDialog::getAddressee( 0 );

    if ( !a.isEmpty() ) {
      kDebug() << "Selected Addressee:";
      kDebug() << a.toString();
    } else {
      kDebug() << "No Addressee selected.";
    }
  }
}
Ejemplo n.º 13
0
int main(int argc, char *argv[])
{
	const KAboutData about(
		"konstruktor", "konstruktor",
		ki18n("Part database updater for Konstruktor"), "0.9.0-beta1",
		ki18n("Updates the part database. Must be called internally by Konstruktor."),
		KAboutData::License_GPL_V3,
		ki18n("(c)2006-2011, Park \"segfault\" Joon-Kyu"));
	
	KCmdLineArgs::init(argc, argv, &about);

	KCmdLineOptions options;
	options.add("+[location]", ki18n("Path to LDraw part library"));
	options.add("rescan", ki18n("Rescan the entire library"));
	KCmdLineArgs::addCmdLineOptions(options);
	
	KApplication app;

	int status;
	try {
		Konstruktor::DBUpdater updater;
		
		status = updater.start();
	} catch (const std::runtime_error &e) {
		QMessageBox::critical(0L, i18n("Error"), QString(e.what()));

		status = -1;
	}
	
	app.exit(status);

	return status;
}
Ejemplo n.º 14
0
int
main(int argc, char *argv[])
{
    KAboutData about("kapptest", 0, ki18n("kapptest"), "version");
    KCmdLineArgs::init(argc, argv, &about);

    KCmdLineOptions options;
    options.add("t");
    options.add("type <name>", ki18n("The type of shutdown to emulate: Default, None, Reboot, Halt or Logout"), "None");
    KCmdLineArgs::addCmdLineOptions(options);

    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();

    KApplication a;
    KIconLoader::global()->addAppDir("ksmserver");
    KSMShutdownFeedback::start();

    QString sdtypeOption = args->getOption("type").toLower();

    KWorkSpace::ShutdownType sdtype = KWorkSpace::ShutdownTypeDefault;
    if (sdtypeOption == "reboot") {
        sdtype = KWorkSpace::ShutdownTypeReboot;
    } else if (sdtypeOption == "halt") {
        sdtype = KWorkSpace::ShutdownTypeHalt;
    } else if (sdtypeOption == "logout") {
        sdtype = KWorkSpace::ShutdownTypeNone;
    }

    QString bopt;
    (void)KSMShutdownDlg::confirmShutdown( true, true, sdtype, bopt, "default" );
/*   (void)KSMShutdownDlg::confirmShutdown( false, false, sdtype, bopt ); */

    KSMShutdownFeedback::stop();
}
Ejemplo n.º 15
0
int main( int argc, char **argv )
{
    KAboutData aboutData("kmenuedit", 0, ki18n("KDE Menu Editor"),
                         version, ki18n(description), KAboutData::License_GPL,
                         ki18n("(C) 2000-2003, Waldo Bastian, Raffaele Sandrini, Matthias Elter"));
    aboutData.addAuthor(ki18n("Waldo Bastian"), ki18n("Maintainer"), "*****@*****.**");
    aboutData.addAuthor(ki18n("Raffaele Sandrini"), ki18n("Previous Maintainer"), "*****@*****.**");
    aboutData.addAuthor(ki18n("Matthias Elter"), ki18n("Original Author"), "*****@*****.**");
    aboutData.addAuthor(ki18n("Montel Laurent"), KLocalizedString(), "*****@*****.**");

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

    KCmdLineOptions options;
    options.add("+[menu]", ki18n("Sub menu to pre-select"));
    options.add("+[menu-id]", ki18n("Menu entry to pre-select"));
    KCmdLineArgs::addCmdLineOptions( options );

    if (!KUniqueApplication::start())
        return 1;

    KMenuApplication app;

    menuEdit = new KMenuEdit();
    menuEdit->show();

    return  app.exec();
}
Ejemplo n.º 16
0
int main(int argc, char** argv)
{
    KAboutData aboutData(
        "fractal-viewer",
        0,
        ki18n("Fractal Viewer"),
        "1.0",
        ki18n("Test program."),
        KAboutData::License_GPL,
        ki18n("(c) 2014 Jordan Melo"),
        ki18n("Enables the exploration and rendering of fractals."),
        "http://jmelo.net/",
        "*****@*****.**"
    );

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

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

    KApplication app;

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

    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();

    return app.exec();
}
Ejemplo n.º 17
0
int main(int argc, char *argv[])
{
	KAboutData about(
		"konstruktor", 0, ki18nc("@title", "Konstruktor"), version, ki18nc("@title", description),
		KAboutData::License_GPL_V3, ki18nc("@info:credit", "(c) 2011, Park \"segfault\" Joon-Kyu")
	);
	about.setHomepage("http://konstruktor.influx.kr");
	about.addAuthor(ki18nc("@info:credit", "Park \"segfault\" Joon-Kyu"),
					ki18nc("@info:credit", "Main developer"),
					"*****@*****.**", "http://planetmono.org");
	about.addCredit(ki18nc("@info:credit", "Lee Olson"),
					ki18nc("@info:credit", "Application icon"),
					"*****@*****.**");
	about.addCredit(ki18nc("@info:credit", "Nathaniel Titane"),
					ki18nc("@info:credit", "Testing"),
					"*****@*****.**");
	
	KCmdLineArgs::init(argc, argv, &about);

	KCmdLineOptions options;
	options.add("+[Url]", ki18nc("@info:shell", "Document to open"));
	KCmdLineArgs::addCmdLineOptions(options);
	
	KApplication app;
	
	Konstruktor::Application mainapp;
	
	return app.exec();
}
Ejemplo n.º 18
0
int main(int argc, char **argv)
{
    KAboutData about("kglobalsettingsclient", 0, ki18n("kglobalsettingsclient"), "version");
    KCmdLineArgs::init(argc, argv, &about);

    KCmdLineOptions options;
    options.add("p", ki18n("emit paletteChanged()"));
    options.add("f", ki18n("emit fontChanged()"));
    options.add("ps", ki18n("emit settingsChanged(SETTINGS_PATH)"));

    KCmdLineArgs::addCmdLineOptions( options );
    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();

    KComponentData componentData(&about); // for KConfig
    QApplication app( KCmdLineArgs::qtArgc(), KCmdLineArgs::qtArgv(), false );

    if (args->isSet("p")) {
        kDebug() << "emitChange(PaletteChanged)";
        KGlobalSettings::self()->emitChange(KGlobalSettings::PaletteChanged);
	return 0;
    } else if (args->isSet("f")) {
        kDebug() << "emitChange(FontChanged)";
        KGlobalSettings::self()->emitChange(KGlobalSettings::FontChanged);
        return 0;
    } else if (args->isSet("ps")) {
        kDebug() << "emitChange(SettingsChanged)";
        KGlobalSettings::self()->emitChange(KGlobalSettings::SettingsChanged, KGlobalSettings::SETTINGS_PATHS);
        return 0;
    }

    KCmdLineArgs::usage("No action specified");
    return 1; //notreached
}
Ejemplo n.º 19
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;
}
Ejemplo n.º 20
0
Archivo: main.cpp Proyecto: KDE/kppp
int main(int argc, char **argv) {
  KAboutData aboutData("kppplogview", 0, ki18n("KPPP Log Viewer"),
    version, ki18n(description), KAboutData::License_GPL,
    ki18n("(c) 1999-2002, The KPPP Developers"));
  aboutData.addAuthor(ki18n("Bernd Wuebben"),KLocalizedString(), "*****@*****.**");
  aboutData.addAuthor(ki18n("Mario Weilguni"));
  aboutData.addAuthor(ki18n("Harri Porten"),KLocalizedString(), "*****@*****.**");
  KCmdLineArgs::init(argc, argv, &aboutData);


  KCmdLineOptions option;

  option.add("kppp", ki18n("Run in KPPP mode"));

  KCmdLineArgs::addCmdLineOptions( option );

  KApplication a;

  loadLogs();

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

  return a.exec();
}
Ejemplo n.º 21
0
Archivo: main.cpp Proyecto: KDE/simon
int main(int argc, char *argv[])
{
  KAboutData aboutData( "simon", 0,
    ki18n("Simon"), simon_version,
    ki18n("<html><head /><body>"
          "<h2>Development and Distribution</h2>"
          "<p>Developed in part by the non-profit organization"
          " <a href=\"http://simon-listens.org\">Simon listens e.V.</a>"
          " in cooperation with <a href=\"http://cyber-byte.at\">Cyber-Byte EDV Services</a>.</p>"
          "<h3>Special Thanks To</h3>"
          "<ul><li>Franz Stieger</li><li>Mathias Stieger</li><li>Phillip Theussl</li><li>Moacyr Prado</li><li>Michael Stieger</li><li>Ralf Herzog</li></ul>"
          "</body></html>"),
          KAboutData::License_GPL,
          ki18n("Copyright (c) 2008-2012 Peter Grasch, Phillip Goriup, Tschernegg Susanne, Bettina Sturmann, Martin Gigerl, Adam Nash, Frederik Gladhorn, Patrick von Reth, Alessadro Buggin, Mario Strametz, Vladislav Sitalo, Yash Shah") );

  KCmdLineOptions options;
  options.add("nosplash", ki18n("Disable Simon's splash screen"));
  KCmdLineArgs::addCmdLineOptions(options);

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

  SimonApplication app;
  app.setWindowIcon(KIcon("simon"));
  app.addLibraryPath(app.applicationDirPath()+"/plugins");

  SimonView *pv = new SimonView();

  Q_UNUSED(pv);
  int ret= app.exec();
//   pv is deleted automatically
  return ret;
}
Ejemplo n.º 22
0
int main ( int argc, char *argv[] )
{

  KAboutData aboutData( "aku", 0, ki18n("aKu"),
      "SVN", ki18n("The RAR application for KDE4"), KAboutData::License_GPL_V3,
      ki18n("Copyright (c) 2008"));
   
  aboutData.addAuthor(ki18n("Alessandro Diaferia aka \"The Speedy Coder\""), ki18n("Main Developer"), "*****@*****.**");
  aboutData.addAuthor(ki18n("Francesco Grieco aka \"The Japanese GUI stylist\""), ki18n("Developer"), "*****@*****.**");
  // chiamata per disattivare il report dei bugs a kde4
  aboutData.setCustomAuthorText(ki18n(0), ki18n(0));
  KCmdLineArgs::init(argc, argv, &aboutData);
  KCmdLineOptions options;
  options.add("+[archive]", ki18n("Makes aKu open the archive specified"));
  options.add("extracthere", ki18n("Extracts all files in the archive path")); // FIXME: extracthere <destination>
  options.add("extractto", ki18n("Extracts all files in a selected path"));
  KCmdLineArgs::addCmdLineOptions( options );

  KApplication app;
  QString loIcon = KIconLoader().iconPath("aku",-KIconLoader::SizeEnormous );
  QApplication::setWindowIcon(KIcon(loIcon));
  //QApplication::setWindowIcon( KIcon( "utilities-file-archiver" ) ); ///TEMP ICON
  QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
  MainWindow * mw = new MainWindow();
  mw->show();
 // KCmdLineArgs *args = KCmdLineArgs::parsedArgs();

  return app.exec();
}
Ejemplo n.º 23
0
Archivo: main.cpp Proyecto: 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());
}
Ejemplo n.º 24
0
int main(int argc, char *argv[])
{
  // kdeinit waits for kcminit to finish, but during KDE startup
  // only important kcm's are started very early in the login process,
  // the rest is delayed, so fork and make parent return after the initial phase
  pipe( ready );
  if( fork() != 0 )
  {
      waitForReady();
      return 0;
  }
  close( ready[ 0 ] );

  startup = ( strcmp( argv[ 0 ], "kcminit_startup" ) == 0 ); // started from startkde?
  KAboutData aboutData( "kcminit", "kcminit", ki18n("KCMInit"),
                        "",
                        ki18n("KCMInit - runs startup initialization for Control Modules."));

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

  KCmdLineOptions options;
  options.add("list", ki18n("List modules that are run at startup"));
  options.add("+module", ki18n("Configuration module to run"));
  KCmdLineArgs::addCmdLineOptions( options ); // Add our own options.

  KApplication app;
  QDBusConnection::sessionBus().interface()->registerService( "org.kde.kcminit",
      QDBusConnectionInterface::DontQueueService );
  KLocale::setMainCatalog(0);
  KCMInit kcminit( KCmdLineArgs::parsedArgs());
  return 0;
}
Ejemplo n.º 25
0
int main(int argc, char *argv[])
{
    KCmdLineArgs::init(argc, argv, "testkhtml", 0, ki18n("Testkhtml"), "1.0",
            ki18n("a basic web browser using the KHTML library"));

    KCmdLineOptions options;
    options.add("+file", ki18n("url to open"));
    KCmdLineArgs::addCmdLineOptions(options);

    KApplication app;
    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
    if (args->count() == 0)
    {
        KCmdLineArgs::usage();
        ::exit( 1 );
    }

    TestKHTML *test = new TestKHTML;
    if (args->url(0).url().right(4).toLower() == ".xml")
    {
        KParts::OpenUrlArguments args(test->doc()->arguments());
        args.setMimeType("text/xml");
        test->doc()->setArguments(args);
    }

    test->openUrl(args->url(0));
    test->show();

    return app.exec();
}
Ejemplo n.º 26
0
int main(int argc, char ** argv)
{
    KCmdLineOptions options;
    options.add("+URL1", ki18n("The first URL to play"));
    options.add("+URL2", ki18n("The second URL to play"));

    KAboutData about("crossfade", 0, ki18n("Phonon Crossfade Example"),
            "1.0", KLocalizedString(),
            KAboutData::License_LGPL);
    about.addAuthor(ki18n("Matthias Kretz"), KLocalizedString(), "*****@*****.**");
    KCmdLineArgs::init(argc, argv, &about);
    KCmdLineArgs::addCmdLineOptions(options);
    KApplication app;
    KUrl url1;
    KUrl url2;
    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
    if (args->count() == 2)
    {
        url1 = args->url(0);
        url2 = args->url(1);
        if (url1.isValid() && url2.isValid())
        {
            Crossfader xfader(url1, url2);
            return app.exec();
        }
    }
    return 1;
}
int main( int argc, char *argv[] )
{
	KAboutData aboutData( "kopetewallettest", 0, ki18n("kopetewallettest"), "version" );
	KCmdLineArgs::init( argc, argv, &aboutData );

	KCmdLineOptions opts;
	opts.add("+action");
	KCmdLineArgs::addCmdLineOptions( opts );
	KApplication app( "kopetewallettest" );

	KCmdLineArgs *args = KCmdLineArgs::parsedArgs();

	// must register with DCOP or async callbacks will fail
	_out << "DCOP registration returned " << app.dcopClient()->registerAs(app.name()) << endl;

	for( int i = 0; i < args->count(); ++i )
	{
		QString arg = args->arg( i );
		_out << "Processing " << arg << endl;
		if( arg == QString::fromLatin1( "open" ) ) openWalletAsync();
		if( arg == QString::fromLatin1( "close" ) ) closeWallet();
		if( arg == QString::fromLatin1( "delay" ) ) delay();
		_out << "Done." << endl;
	}

	WalletReciever *r = new WalletReciever;

	QTimer timer;
	r->connect( &timer, SIGNAL(timeout()), SLOT(timer()) );
	timer.start( 1000 );

	_out << "About to start 30 second event loop" << endl;
	QTimer::singleShot( 30000, qApp, SLOT(quit()) );
	return qApp->exec();
}
Ejemplo n.º 28
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;
}
Ejemplo n.º 29
0
int main(int argc, char **argv)
{
    KCmdLineOptions options;
    options.add("testall", ki18n("Downloads all previews and payloads"));

    KCmdLineArgs::init(argc, argv, "knewstuff2_test", 0, ki18n("knewstuff2_test"), 0);
    KCmdLineArgs::addCmdLineOptions(options);
    KApplication app(false);

    // Take source directory into account
    kDebug() << "-- adding source directory " << KNSSRCDIR;
    kDebug() << "-- adding build directory " << KNSBUILDDIR;
    KGlobal::dirs()->addResourceDir("config", KNSSRCDIR);
    KGlobal::dirs()->addResourceDir("config", KNSBUILDDIR);

    KNewStuff2Test *test = new KNewStuff2Test();
    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
    if (args->isSet("testall")) {
        test->setTestAll(true);
        test->entryTest();
        test->providerTest();
    }
    test->engineTest();

    return app.exec();
}
Ejemplo n.º 30
0
int main(int argc, char **argv)
{
    KAboutData aboutData("kstartperf", 0, ki18n("KStartPerf"),
	    "1.0", ki18n("Measures start up time of a KDE application"),
	    KAboutData::License_Artistic,
	    ki18n("Copyright (c) 2000 Geert Jansen and libkmapnotify authors"));
    aboutData.addAuthor(ki18n("Geert Jansen"), ki18n("Maintainer"),
	    "*****@*****.**", "http://www.stack.nl/~geertj/");

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

    KCmdLineOptions options;
    options.add("+command", ki18n("Specifies the command to run"));
    options.add("!+[args]", ki18n("Arguments to 'command'"));
    KCmdLineArgs::addCmdLineOptions(options);
    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();

    KComponentData componentData( &aboutData );
    QCoreApplication app( KCmdLineArgs::qtArgc(), KCmdLineArgs::qtArgv() );

    // Check arguments

    if (args->count() == 0)
    {
	fprintf(stderr, "No command specified!\n");
	fprintf(stderr, "usage: kstartperf command [arguments]\n");
	exit(1);
    }

    // Build command

    char cmd[1024];
    snprintf(cmd, sizeof(cmd), "LD_PRELOAD=%s %s", 
             qPrintable( libkstartperf() ), qPrintable(args->arg(0)));
    for (int i=1; i<args->count(); i++)
    {
	strcat(cmd, " ");
	strcat(cmd, args->arg(i).toLocal8Bit());
    }

    // Put the current time in the environment variable `KSTARTPERF'

    struct timeval tv;
    if (gettimeofday(&tv, 0L) != 0)
    {
	perror("gettimeofday()");
	exit(1);
    }
    char env[100];
    sprintf(env, "KSTARTPERF=%ld:%ld", tv.tv_sec, tv.tv_usec);
    putenv(env);

    // And exec() the command

    execl("/bin/sh", "sh", "-c", cmd, (void *)0);

    perror("execl()");
    exit(1);
}