当前位置: 首页>>代码示例>>C++>>正文


C++ KCmdLineOptions类代码示例

本文整理汇总了C++中KCmdLineOptions的典型用法代码示例。如果您正苦于以下问题:C++ KCmdLineOptions类的具体用法?C++ KCmdLineOptions怎么用?C++ KCmdLineOptions使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了KCmdLineOptions类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

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( "[email protected]" ),
				"(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() ;
	}
}
开发者ID:Miestro,项目名称:qCheckGMail,代码行数:30,代码来源:main.cpp

示例2: main

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"),
        "[email protected]");

    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();
}
开发者ID:theunbelievablerepo,项目名称:gwenview,代码行数:35,代码来源:main.cpp

示例3: main

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;
}
开发者ID:KDE,项目名称:kde-runtime,代码行数:30,代码来源:khotnewstuff_upload.cpp

示例4: main

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;
}
开发者ID:KDE,项目名称:kde-workspace,代码行数:27,代码来源:Installer.cpp

示例5: main

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(), "[email protected]", "http://majewsky.wordpress.com");
	about.addCredit (ki18n ("Johannes Loehnert"),
			 ki18n ("The option to preview the completed puzzle"),
			 "[email protected]");
	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();
}
开发者ID:KDE,项目名称:palapeli,代码行数:29,代码来源:main.cpp

示例6: main

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();
}
开发者ID:akhuettel,项目名称:kdepim-noakonadi,代码行数:26,代码来源:groupwisemain.cpp

示例7: main

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, "[email protected]");
                     about.addAuthor( ki18n("Marco Martin"), KLocalizedString(), "[email protected]" );
    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();
}
开发者ID:Axure,项目名称:okular,代码行数:26,代码来源:main.cpp

示例8: main

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;
}
开发者ID:NathanDM,项目名称:kipi-plugins,代码行数:31,代码来源:main.cpp

示例9: main

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();
}
开发者ID:choueric,项目名称:kscope-4,代码行数:26,代码来源:main.cpp

示例10: main

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.";
    }
  }
}
开发者ID:lenggi,项目名称:kcalcore,代码行数:30,代码来源:testkabcdlg.cpp

示例11: main

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;
}
开发者ID:rhabacker,项目名称:Konstruktor,代码行数:33,代码来源:main_dbupdater.cpp

示例12: main

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();
}
开发者ID:mgottschlag,项目名称:kwin-tiling,代码行数:34,代码来源:test.cpp

示例13: main

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"), "[email protected]");
    aboutData.addAuthor(ki18n("Raffaele Sandrini"), ki18n("Previous Maintainer"), "[email protected]");
    aboutData.addAuthor(ki18n("Matthias Elter"), ki18n("Original Author"), "[email protected]");
    aboutData.addAuthor(ki18n("Montel Laurent"), KLocalizedString(), "[email protected]");

    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();
}
开发者ID:fluxer,项目名称:kde-workspace,代码行数:28,代码来源:main.cpp

示例14: main

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/",
        "[email protected]"
    );

    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();
}
开发者ID:jamelo,项目名称:fraktal,代码行数:30,代码来源:main.cpp

示例15: main

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"),
					"[email protected]", "http://planetmono.org");
	about.addCredit(ki18nc("@info:credit", "Lee Olson"),
					ki18nc("@info:credit", "Application icon"),
					"[email protected]");
	about.addCredit(ki18nc("@info:credit", "Nathaniel Titane"),
					ki18nc("@info:credit", "Testing"),
					"[email protected]");
	
	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();
}
开发者ID:wawanbreton,项目名称:Konstruktor,代码行数:29,代码来源:main.cpp


注:本文中的KCmdLineOptions类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。