Beispiel #1
0
int
parseCommandLine( int argc, char **argv )
{
	QString param, name, value;
	int i;
	char *s, locale[50]="ru";

	strncpy( locale, QTextCodec::locale(), sizeof( locale ) );
	s = strchr( locale, '_' );
	if ( s ) {
	    *s = 0;
	}
        lang = locale;
        setTranslator( lang );
//	printf("locale=%s\n", locale );
	QString str_ru=QString::null, str_en=QString::null;
	bool lang_setted = false;
	bool help_setted = false;
	for ( i=1; i<argc; i++)
	{
	    param = argv[i];
	    name = param.section("=",0,0).lower();
	    value = param.section("=",1);
//	    printf("%s = %s\n", (const char *) name, (const char *) value );
	    if (param == "--help")
	    {
		    str_ru = "Использование: ananas [--help] [--lang=<LANG>] [--rc=<RC_PATH>]\n";
		    str_ru+= "LANG=ru|en\n";
		    str_ru+= "RC_PATH=путь к *.rc файлу описания бизнес схемы\n";

	    	    str_en = "Usage: ananas [--help] [--lang=<LANG>] [--rc=<RC_PATH>]\n";
		    str_en+= "LANG=ru|en\n";
		    str_en+= "RC_PATH=path to *.rc file of paticular business scheme\n";
		    help_setted = true;

	    }
	    if (name == "--lang") {
		lang = value;
		lang_setted = true;
	        setTranslator( lang );
	    }
	    if (name == "--rc") rcfile = value;
	}
	if(help_setted)
	{
		if(lang == "ru")
		{
			printf("%s",(const char*)str_ru.local8Bit());
		}
		else
		{
			printf("%s",str_en.ascii());
		}
		return 1;
	}
	return 0;
}
KexiAboutData::KexiAboutData()
 : KAboutData(
        "kexi",
        KEXI_APP_NAME,
        Kexi::fullVersionString(),
        xi18n(description),
        KAboutLicense::LGPL_V2,
        xi18n("© 2002-%1, The Kexi Team", QLatin1String(CALLIGRA_YEAR)),
        xi18n("This software is developed by Kexi Team - an international group "
              "of independent developers. They form a part of the Calligra Project."),
        "http://www.calligra.org/kexi",
        "*****@*****.**"
    )
{
    setOrganizationDomain("kde.org"); // right dbus prefix == org.kde.

    // authors sorted by last nontrivial contribution date * size
    addAuthor(
        xi18n("Jarosław Staniek"), xi18n("Project maintainer & developer, overall design"), "*****@*****.**");
    addAuthor(
        xi18n("OpenOffice Polska LLC"), xi18n("Sponsoring and support (employer of Jarosław Staniek in 2003-2007)"), "*****@*****.**");
    addAuthor(
        xi18n("Adam Pigg"), xi18n("PostgreSQL database driver, Migration and Reporting modules, numerous bug fixes"), "*****@*****.**");
    addAuthor(
        xi18n("Radosław Wicik"), xi18n("Map elements for forms and reports, map flake shape"), "*****@*****.**");
    addAuthor(
        xi18n("Wojciech Kosowicz"), xi18n("Features and bug fixes"), "*****@*****.**");
    addAuthor(
        xi18n("Roman Shtemberko"), xi18n("Features and bug fixes"), "*****@*****.**");
    addAuthor(
        xi18n("Dimitrios T. Tanis"), xi18n("Users Manual for Kexi 2, main window improvements, numerous bug reports"),  "*****@*****.**");
    addAuthor(
        xi18n("Oleg Kukharchuk"), xi18n("Several form widgets, porting to Qt 4, stabilization"), "*****@*****.**");
    addAuthor(
        xi18n("Shreya Pandit"), xi18n("Web elements for forms and reports"), "*****@*****.**");
    addAuthor(
        xi18n("Sebastian Sauer"), xi18n("Scripting module (KROSS), Python language bindings, design"), "*****@*****.**");
    addAuthor(
        xi18n("Lorenzo Villani"), xi18n("Web Forms module"), "*****@*****.**");
    addAuthor(
        xi18n("Sharan Rao"), xi18n("Sybase/MS SQL Server/ODBC database drivers, xBase migration plugin, improvements for KexiDB"), "*****@*****.**");
    addAuthor(
        xi18n("Cédric Pasteur"), xi18n("First version of Property Editor and Form Designer"), "*****@*****.**");
    addAuthor(
        xi18n("Martin Ellis"), xi18n("Contributions for MySQL and KexiDB, fixes, Migration module, MS Access file format support"), "*****@*****.**");
    addAuthor(
        xi18n("Julia Sanchez-Simon"), xi18n("Oracle database driver"), "*****@*****.**");
    addAuthor(
        xi18n("Christian Nitschkowski"), xi18n("Graphics effects, helper dialogs"), "*****@*****.**");
    addAuthor(
        xi18n("Matt Rogers"), xi18n("ODBC database driver"), "*****@*****.**");
    addAuthor(
        xi18n("Lucijan Busch"), xi18n("Former project maintainer & developer"), "*****@*****.**");
    addAuthor(
        xi18n("Peter Simonsson"), xi18n("Former developer"), "*****@*****.**");
    addAuthor(
        xi18n("Joseph Wenninger"), xi18n("Original Form Designer, original user interface & much more"), "*****@*****.**");
    addAuthor(
        xi18n("Seth Kurzenberg"), xi18n("CQL++, SQL assistance"),  "*****@*****.**");
    addAuthor(
        xi18n("Laurent Montel"), xi18n("Original code cleanings"), "*****@*****.**");
    addAuthor(
        xi18n("Till Busch"), xi18n("Bugfixes, original Table Widget"), "*****@*****.**");

    addCredit(
        xi18n("Ian Balchin"), xi18n("Numerous bug reports and tests, handbook improvements"), "*****@*****.**");
    addCredit(
        xi18n("Robert Leleu"), xi18n("Numerous bug reports and tests"), "*****@*****.**");
    addCredit(
        xi18n("Friedrich W. H. Kossebau"), xi18n("Bug fixes, build system improvements, code cleanups"), "*****@*****.**");
    addCredit(
        xi18n("Boudewijn Rempt"), xi18n("Code cleanups"), "*****@*****.**");
    addCredit(
        xi18n("David Faure"), xi18n("Code cleanups"), "*****@*****.**");
    addCredit(
        xi18n("Daniel Molkentin"), xi18n("Initial design improvements"),  "*****@*****.**");
    addCredit(
        xi18n("Kristof Borrey"), xi18n("Icons and user interface research"), "*****@*****.**");
    addCredit(
        xi18n("Tomas Krassnig"), xi18n("Coffee sponsoring"), "*****@*****.**");
    addCredit(
        xi18n("Paweł Wirecki / OpenOffice Polska"), xi18n("Numerous bug reports, usability tests, technical support"));

    setTranslator(
        xi18nc("NAME OF TRANSLATORS", "Your names"), xi18nc("EMAIL OF TRANSLATORS", "Your emails"));
}
Beispiel #3
0
int
parseCommandLine( int argc, char **argv )
{
    QString param, name, value;
    int i;
    char buf[2048];
    TEScalesBase *newunit;

    for ( i=1; i<argc; i++) {
        param = argv[i];
        name = param.section("=",0,0).lower();
        value = param.section("=",1);
//      printf("%s = %s\n", (const char *) name, (const char *) value );
        if (name == "--lang") {
            lang = value;
            setTranslator( lang );
        }
        if (name == "--rc") rcfile = value;
        if (name == "--model") {
            newunit = (TEScalesBase*) TEFactory::create( value );
            if ( newunit && newunit->inherits("TEScalesBase") ) {
                delete unit;
                unit = newunit;
            }
        }
        if (name == "--port") {
            serialport = value.toInt();
            unit->setPortNumber( serialport );
        }
        if (name == "--help") {
            printHelp();
            return 1;
        }
        if (name == "--debug") {
            debuglevel = 1;
            unit->setDebugLevel( 1 );
        }
        if (name == "--rc") rcfile=value;
        if (name == "--batch") batch = 1;
        if (name == "--price") {
            if ( !modelnumber ) continue;
            if ( !value.isEmpty() ) {
                unit->open();
                unit->setPrice( value.toDouble() );
                unit->close();
            }
        }
        if (name == "--get") {
            if ( !modelnumber ) continue;
            int rc = 0;
            unit->open();
            if ( !unit->isOpen() ) rc = 1;
            if ( !unit->readDisplay() ) rc = 2;
            sprintf(buf,"NAME=SCALES;RC=%i;WEIGHT=%.3f;PRICE=%.2f;SUMMA=%.2f\n",
                    rc, unit->weight(), unit->price(), unit->summa() );
            if ( !rcfile.isEmpty() ) {
                QFile f( rcfile );
                f.open(IO_WriteOnly);
                f.writeBlock( buf, strlen(buf) );
                f.close();
            } else {
                printf(buf);
            }
            unit->close();
        }
    }
    if ( !modelnumber  && batch ) {
        printf(( const char *) QObject::tr("unknown scales model.\n"));
        return 1;
    }
    return 0;
}