コード例 #1
0
KDE_EXPORT int kdemain(int argc, char **argv)
{
    KAboutData aboutdata("knotify", I18N_NOOP("KNotify"), "3.0", I18N_NOOP("KDE Notification Server"), KAboutData::License_GPL,
                         "(C) 1997-2003, KDE Developers");
    aboutdata.addAuthor("Carsten Pfeiffer", I18N_NOOP("Current Maintainer"), "*****@*****.**");
    aboutdata.addAuthor("Christian Esken", 0, "*****@*****.**");
    aboutdata.addAuthor("Stefan Westerfeld", I18N_NOOP("Sound support"), "*****@*****.**");
    aboutdata.addAuthor("Charles Samuels", I18N_NOOP("Previous Maintainer"), "*****@*****.**");

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


    // initialize application
    if(!KUniqueApplication::start())
    {
        kdDebug() << "Running knotify found" << endl;
        return 0;
    }

    KUniqueApplication app;
    app.disableSessionManagement();

    // start notify service
    KNotify *notify = new KNotify();

    app.dcopClient()->setDefaultObject("Notify");
    app.dcopClient()->setDaemonMode(true);
    // kdDebug() << "knotify starting" << endl;

    int ret = app.exec();
    delete notify;

    return ret;
}
コード例 #2
0
ファイル: main.cpp プロジェクト: kcroot/Kup
int main(int argc, char **argv) {
	KupDaemon *lDaemon = new KupDaemon();
	if(!lDaemon->shouldStart()) {
		qWarning() <<ki18n("Kup is not enabled, enable it from the system settings module.").toString();
		return 0;
	}
	KAboutData lAbout("kupdaemon", "kup", ki18nc("@title", "Kup Daemon"), version, ki18n(description),
	                  KAboutData::License_GPL, ki18n("Copyright (C) 2011 Simon Persson"),
	                  KLocalizedString(), 0, "*****@*****.**");
	lAbout.addAuthor(ki18n("Simon Persson"), KLocalizedString(), "*****@*****.**");
	KCmdLineArgs::init(argc, argv, &lAbout);

	KUniqueApplication::addCmdLineOptions();
	if (!KUniqueApplication::start()) {
		qWarning() <<ki18n("Kup is already running!").toString();
		return 0;
	}
	KUniqueApplication lApp;

	// Use for debugging...
	//		KApplication lApp;

	lApp.setQuitOnLastWindowClosed(false);
	lApp.disableSessionManagement();

	KStartupInfo::appStarted(); //make startup notification go away.

	lDaemon->setupGuiStuff();

	return lApp.exec();
}
コード例 #3
0
ファイル: main.cpp プロジェクト: KDE/kde-runtime
extern "C" KDE_EXPORT int kdemain(int argc, char **argv)
{
    //  GS 5/2001 - I changed the name to "KDE" to make it look better
    //              in the titles of dialogs which are displayed.
    KAboutData aboutdata("kuiserver", "kdelibs4", ki18n("Job Manager"),
                         "0.8", ki18n("KDE Job Manager"),
                         KAboutData::License_GPL_V2, ki18n("(C) 2000-2009, KDE Team"));

    aboutdata.addAuthor(ki18n("Shaun Reich"), ki18n("Maintainer"), "*****@*****.**");
    aboutdata.addAuthor(ki18n("Rafael Fernández López"), ki18n("Former Maintainer"), "*****@*****.**");
    aboutdata.addAuthor(ki18n("David Faure"), ki18n("Former maintainer"), "*****@*****.**");
    aboutdata.addAuthor(ki18n("Matej Koss"), ki18n("Developer"), "*****@*****.**");

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

    if (!KUniqueApplication::start()) {
        kDebug(7024) << "kuiserver is already running!";
        return 0;
    }

    KUniqueApplication app;

    // This app is started automatically, no need for session management
    app.disableSessionManagement();
    app.setQuitOnLastWindowClosed(false);

    ProgressListModel model;

    return app.exec();
}
コード例 #4
0
extern "C" KDE_EXPORT int kdemain(int argc, char **argv)
{
    KLocale::setMainCatalogue("kdelibs");
    //  GS 5/2001 - I changed the name to "KDE" to make it look better
    //              in the titles of dialogs which are displayed.
    KAboutData aboutdata("kio_uiserver", I18N_NOOP("KDE"), "0.8", I18N_NOOP("KDE Progress Information UI Server"), KAboutData::License_GPL,
                         "(C) 2000, David Faure & Matt Koss");
    // Who's the maintainer ? :)
    aboutdata.addAuthor("David Faure", I18N_NOOP("Developer"), "*****@*****.**");
    aboutdata.addAuthor("Matej Koss", I18N_NOOP("Developer"), "*****@*****.**");

    KCmdLineArgs::init(argc, argv, &aboutdata);
    // KCmdLineArgs::addCmdLineOptions( options );
    KUniqueApplication::addCmdLineOptions();

    if(!KUniqueApplication::start())
    {
        kdDebug(7024) << "kio_uiserver is already running!" << endl;
        return (0);
    }

    KUniqueApplication app;

    // This app is started automatically, no need for session management
    app.disableSessionManagement();
    app.dcopClient()->setDaemonMode(true);

    uiserver = UIServer::createInstance();

    //    app.setMainWidget( uiserver );

    return app.exec();
}
コード例 #5
0
extern "C" int KDE_EXPORT kdemain(int argc, char *argv[])
{
  Klipper::createAboutData();
  KCmdLineArgs::init( argc, argv, Klipper::aboutData());
  KUniqueApplication::addCmdLineOptions();

  if (!KUniqueApplication::start()) {
       fprintf(stderr, "Klipper is already running!\n");
       exit(0);
  }
  KUniqueApplication app;
  app.disableSessionManagement();

  Klipper *toplevel = new Klipper();

  // Make Klipper conform to freedesktop system tray standard, see
  // http://bugs.kde.org/show_bug.cgi?id=69119
#if defined Q_WS_X11 && ! defined K_WS_QTONLY
  QXEmbed::initialize();
#endif

  KWin::setSystemTrayWindowFor( toplevel->winId(), 0 );
  toplevel->setGeometry(-100, -100, 42, 42 );
  toplevel->show();

  int ret = app.exec();
  delete toplevel;
  Klipper::destroyAboutData();
  return ret;
}
コード例 #6
0
int main(int argc, char *argv[])
{
    KAboutData aboutData( "amor", I18N_NOOP("amor"),
        AMOR_VERSION, description, KAboutData::License_GPL,
        "(c) 1999, Martin R. Jones");
    aboutData.addAuthor("Martin R. Jones",0, "*****@*****.**");
    aboutData.addAuthor("Gerardo Puga", I18N_NOOP("Current maintainer"), "*****@*****.**"); 
    KCmdLineArgs::init( argc, argv, &aboutData );

    if (!KUniqueApplication::start()) {
	fprintf(stderr, "%s is already running!\n", aboutData.appName());
	exit(0);
    }
    KUniqueApplication app;

    // session management
    AmorSessionWidget *sessionWidget = new AmorSessionWidget;
    app.setTopWidget(sessionWidget);

    new Amor();

    app.dcopClient()->setDefaultObject( "AmorIface" );

    return app.exec();
}
コード例 #7
0
ファイル: main.cpp プロジェクト: Miestro/qCheckGMail
int startApp( void )
{
	if( KUniqueApplication::start() ){
		KUniqueApplication a ;
		qCheckGMail w;
		w.start();
		return a.exec();
	}else{
		return qCheckGMail::instanceAlreadyRunning() ;
	}
}
コード例 #8
0
int main(int argc, char **argv)
{
  KCmdLineArgs::init(argc, argv, "secpolicy", description, version);

  if (!KUniqueApplication::start())
     exit(0);

  KUniqueApplication app;
  SecPolicyWin *spWin = new SecPolicyWin();

  app.setMainWidget(spWin);
  return app.exec();
}
コード例 #9
0
ファイル: main.cpp プロジェクト: ayoy/kaveau
int main (int argc, char *argv[])
{
  KAboutData aboutData( "kaveau", 0, ki18n("kaveau"), "0.0.1",
                          ki18n("A simple backup tool"),
                          KAboutData::License_GPL,
                          ki18n("Copyright (c) 2009 Flavio Castelli") );

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

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

  return app.exec();
}
コード例 #10
0
ファイル: main.cpp プロジェクト: KDE/mangonel
int main(int argc, char** argv)
{
    KAboutData* aboutData = new KAboutData(
                       QByteArray("mangonel"),
                       QByteArray("mangonel"),
                       ki18n("Mangonel"),
                       QByteArray("1.1"),
                       ki18n("A simple application launcher for KDE4."));
    aboutData->setHomepage(QByteArray("www.tarmack.eu/mangonel/"));
    aboutData->addAuthor(ki18n("Martin Sandsmark"), ki18n("Developer"), "*****@*****.**", "http://iskrembilen.com/");
    aboutData->addAuthor(ki18n("Bart Kroon"), ki18n("Developer, original author"), "", "http://tarmack.eu/");
    KCmdLineArgs::init(argc, argv, aboutData);
    KUniqueApplication app;
    app.setQuitOnLastWindowClosed(false);
    app.setOrganizationName("Tarmack SW");
    Mangonel foo(&app);
    return app.exec();
}
コード例 #11
0
ファイル: main.cpp プロジェクト: jcaden/BlueZ-Manager
int main(int argc, char *argv[])
{
	KAboutData aboutData( "bluezManager", NULL,
		ki18n("BlueZ Manager"), "1.0",
		ki18n("A Bluetooth Manager for KDE."),
		KAboutData::License_GPL_V3,
		ki18n("Copyright (c) 2010 José Antonio Santos Cadenas"));
	KCmdLineArgs::init(argc, argv, &aboutData);

	aboutData.addAuthor(ki18n("José Antonio Santos Cadenas"),
				ki18n("Developer and Project founder"),
				"*****@*****.**");
	aboutData.setProgramIconName("preferences-system-bluetooth");
	KUniqueApplication app;
	app.setQuitOnLastWindowClosed(false);
	MainWindow window;
	return app.exec();
}
コード例 #12
0
int main( int argc, char **argv )
{
  AboutData about;

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

  KCmdLineOptions options;
  KCmdLineArgs::addCmdLineOptions( options );
  KUniqueApplication::addCmdLineOptions();

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

  KUniqueApplication app;
  KAddressBook::insertLibraryCatalogues();
  MainWindow *window = new MainWindow;
  window->show();

  return app.exec();
}
コード例 #13
0
ファイル: main.cpp プロジェクト: dhirajkhatiwada1/uludag
int main(int argc, char **argv)
{
    KAboutData aboutdata("knotify", "knotify4", ki18n("KNotify"),
                         "4.0", ki18n("KDE Notification Daemon"),
                         KAboutData::License_GPL, ki18n("(C) 1997-2008, KDE Developers"));
    aboutdata.addAuthor(ki18n("Olivier Goffart"),ki18n("Current Maintainer"),"*****@*****.**");
    aboutdata.addAuthor(ki18n("Carsten Pfeiffer"),ki18n("Previous Maintainer"),"*****@*****.**");
    aboutdata.addAuthor(ki18n("Christian Esken"),KLocalizedString(),"*****@*****.**");
    aboutdata.addAuthor(ki18n("Stefan Westerfeld"),ki18n("Sound support"),"*****@*****.**");
    aboutdata.addAuthor(ki18n("Charles Samuels"),ki18n("Previous Maintainer"),"*****@*****.**");
    aboutdata.addAuthor(ki18n("Allan Sandfeld Jensen"),ki18n("Porting to KDE 4"),"*****@*****.**");

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

    // initialize application
    if ( !KUniqueApplication::start() ) {
        kDebug() << "Running knotify found";
        return 0;
    }

    // do not connect to ksmserver at all, knotify is launched on demand and doesn't need
    // to know about logout, and moreover it may be ksmserver who tries to launch knotify,
    // in which case there is a deadlock with ksmserver waiting for knotify to finish
    // startup and knotify waiting to register with ksmserver
    unsetenv( "SESSION_MANAGER" ); 
    KUniqueApplication app;
    
    /*
     * the default KMessageBoxMessageHandler will do messagesbox that notify
     * so we have a deadlock if one debug message is shown as messagebox.
     * that's why we're forced to change the default handler
     */
    KMessage::setMessageHandler( new KPassivePopupMessageHandler(0) );

    // start notify service
    KNotify notify;

    return app.exec();
}
コード例 #14
0
int main(int argc, char **argv)
{
	KAboutData about("konference", I18N_NOOP("konference"), version, description,
	                 KAboutData::License_GPL, "(C) 2005 Malte Boehme", 0, 0, "*****@*****.**");
	about.addAuthor( "Malte Boehme", 0, "*****@*****.**" );
	about.addCredit( "Paul Volkaerts","MythPhone (i took the codec-, sip-, webcam- and rtp-code)", "*****@*****.**");
	KCmdLineArgs::init(argc, argv, &about);
	KCmdLineArgs::addCmdLineOptions( options );
	KUniqueApplication app;

	// see if we are starting with session management
	if (app.isRestored())
	{
		RESTORE(Konference);
	}
	else
	{
		// no session.. just start up normally
		KCmdLineArgs *args = KCmdLineArgs::parsedArgs();

		if ( args->count() == 0 )
		{
			Konference *widget = new Konference;
			widget->show();
		}
		else
		{
			int i = 0;
			for (; i < args->count(); i++ )
			{
				Konference *widget = new Konference;
				widget->show();
				widget->load( args->url( i ) );
			}
		}
		args->clear();
	}

	return app.exec();
}
コード例 #15
0
ファイル: main.cpp プロジェクト: rene-s/KdeLearningAid
int main(int argc, char **argv)
{
    KAboutData about("klaid", I18N_NOOP("K Learning Aid"), "0.0", description,
                     KAboutData::License_GPL, "(C) %{YEAR} Rene Schmidt", 0, 0, "*****@*****.**");
    about.addAuthor( "Rene Schmidt", 0, "*****@*****.**" );

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

    if (!KUniqueApplication::start())
    {
      fprintf(stderr, "KLAid is already running!\n");
      exit(0);
    }
    KUniqueApplication app;

//     KApplication app;

    KLAidWidget *mainWin = 0;
    mainWin = new KLAidWidget;
    app.setMainWidget( mainWin );
    return app.exec();
}
コード例 #16
0
int main(int argc, char *argv[])
{
	KAboutData aboutData( "kmousetool", I18N_NOOP("KMouseTool"),
	KMOUSETOOL_VERSION, description, KAboutData::License_GPL,
	"(c) 2002-2003, Jeff Roush\n(c) 2003, Gunnar Schmi Dt", 0, "http://www.mousetool.com", "*****@*****.**");

	aboutData.addAuthor("Gunnar Schmi Dt", I18N_NOOP("Current maintainer"), "*****@*****.**", "http://www.schmi-dt.de");
	aboutData.addAuthor("Olaf Schmidt", I18N_NOOP("Usability improvements"), "*****@*****.**");
	aboutData.addAuthor("Jeff Roush", I18N_NOOP("Original author"), "*****@*****.**", "http://www.mousetool.com");

	aboutData.addCredit("Joe Betts");
	KCmdLineArgs::init( argc, argv, &aboutData );
	KCmdLineArgs::addCmdLineOptions( options ); // Add our own options.
	KUniqueApplication::addCmdLineOptions();

	if (!KUniqueApplication::start()) {
		DCOPClient *client = new DCOPClient();
		client->attach();
		QByteArray  data;
		QCString    replyType;
		QByteArray  replyData;
		if ( !client->call("kmousetool", "qt/KMouseToolUI", "show()",
					data, replyType, replyData, true) ||
			!client->call("kmousetool", "qt/KMouseToolUI", "raise()",
					data, replyType, replyData, true) )
		fprintf(stderr, "The DCOP calls failed\n");
		delete client;
		exit(0);
	}
	KUniqueApplication a;

	KMouseTool *kmousetool = new KMouseTool();

	if (!kapp->config()->readBoolEntry("IsMinimized", false))
		kmousetool->show();

	return a.exec();
}
コード例 #17
0
ファイル: main.cpp プロジェクト: KDE/nepomuk-core
int main( int argc, char** argv )
{
    KAboutData aboutData( "nepomukcleaner",
                          "nepomukcleaner",
                          ki18n("Nepomuk Cleaner"),
                          NEPOMUK_VERSION_STRING,
                          ki18n("An Application to clean old and invalid Nepomuk data"),
                          KAboutData::License_GPL,
                          ki18n("(c) 2012, Vishesh Handa"),
                          KLocalizedString(),
                          "http://nepomuk.kde.org" );
    aboutData.setProgramIconName( "nepomuk" );
    aboutData.addAuthor(ki18n("Vishesh Handa"),ki18n("Maintainer"), "*****@*****.**");

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

    KUniqueApplication app;

    MainWindow window;
    window.show();

    return app.exec();
}
コード例 #18
0
ファイル: main.cpp プロジェクト: blue-shell/kfilebox
int main(int argc, char** argv)
{
    KAboutData aboutData(
                "kfilebox",
                0,
                ki18n("kfilebox"),
                "0.4.9",
                ki18n("KDE Dropbox frontend"),
                KAboutData::License_GPL_V3,
                ki18n("(c) 2011"),
				ki18n("Kfilebox is a KDE frontend to Dropbox"),
				"http://sourceforge.net/projects/kdropbox/",
                "*****@*****.**");

    aboutData.setBugAddress("http://sourceforge.net/apps/trac/kdropbox/report/1");
    KCmdLineArgs::init( argc, argv, &aboutData );
    KUniqueApplication a;
    KUniqueApplication::setQuitOnLastWindowClosed(false);

    MainWindow w;
    Q_UNUSED(w);

    return a.exec();
}
コード例 #19
0
ファイル: kcontrol_main.cpp プロジェクト: Fat-Zer/tdebase
extern "C" int KDE_EXPORT kdemain( int argc, char **argv )
{
    TDELocale::setMainCatalogue("kmenuedit");
    TDEAboutData aboutData("kcontroledit", I18N_NOOP("Trinity Control Center Editor"),
			 version, description, TDEAboutData::License_GPL,
			 "(C) 2000-2004, Waldo Bastian, Raffaele Sandrini, Matthias Elter");
    aboutData.addAuthor("Waldo Bastian", I18N_NOOP("Maintainer"), "*****@*****.**");
    aboutData.addAuthor("Raffaele Sandrini", I18N_NOOP("Previous Maintainer"), "*****@*****.**");
    aboutData.addAuthor("Matthias Elter", I18N_NOOP("Original Author"), "*****@*****.**");

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

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

    KUniqueApplication app;

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

    app.setMainWidget(menuEdit);
    return  app.exec();
}
コード例 #20
0
ファイル: main.cpp プロジェクト: KdeOs/Tribe
int main(int argc, char *argv[])
{
    KAboutData aboutData("installer", 0, ki18n("Installer"),
    TRIBE_VERSION, ki18n("Graphical Installer for KaOS, forked from the Chakra-Project"), KAboutData::License_GPL,
                        ki18n("(c) 2008 - 2012 the Chakra Development Team"), ki18n("*****@*****.**"), "http://chakra-project.org");
    aboutData.addAuthor(ki18n("Manuel Tortosa"), ki18n("Maintainer"), "*****@*****.**", "http://chakra-project.org"); 
    aboutData.addAuthor(ki18n("Dario Freddi"), ki18n("Developer"), "*****@*****.**", "http://drfav.wordpress.com");
    aboutData.addAuthor(ki18n("Lukas Appelhans"), ki18n("Developer"), "*****@*****.**", "http://boom1992.wordpress.com");
    aboutData.addAuthor(ki18n("Jan Mette"), ki18n("PostInstall Backend and Artwork"), "", "");
    aboutData.addAuthor(ki18n("Phil Miller"), ki18n("PostInstall Backend"), "*****@*****.**", "http://chakra-project.org");
    aboutData.addAuthor(ki18n("Drake Justice"), ki18n("Developer"), "*****@*****.**", "");
    aboutData.addAuthor(ki18n("Georg Grabler"), ki18n("Developer"), "*****@*****.**", "");
    aboutData.addAuthor(ki18n("Daniele Cocca"), ki18n("Developer"), "*****@*****.**", "");
    aboutData.setBugAddress("http://kaosx.us/phpBB3/");

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

    if (!KUniqueApplication::start()) {
        qWarning("Installer is already running!\n");
        return 0;
    }

    // TODO: Port to KDBusService with FrameWorks5
    KUniqueApplication app;

    app.setWindowIcon(KIcon("tribe"));
    
    // Check the available memory before starting
    QFile memfile;
    memfile.setFileName("/proc/meminfo");
    if (memfile.open(QIODevice::ReadOnly | QIODevice::Text)) {
        QTextStream in(&memfile);
        QString totalmem = in.readLine();
        memfile.close();               

        totalmem.remove(QRegExp("[^\\d]"));
        uint ram = (totalmem.toUInt() / 1024);

        qDebug() << ":: Starting Installer, RAM available for this install: " << ram << " Mbytes";
    
        if (ram < MIN_MEMORY) {
            int m = KMessageBox::warningContinueCancel(0, i18n("Your system does not meet the minimal memory needed\n"
                    "for installing KaOS with Installer (1gb), total available memory: %1 mbytes\n\n"
                    "Continue at your own risk", ram));
            if (m == KMessageBox::Cancel)
                return 0;
        }
    }
    
    // Check if we have a battery and if the power addaptop is plugged
    bool pu = false;

    foreach(const Solid::Device &device, Solid::Device::listFromType(Solid::DeviceInterface::Battery, QString())) {
        const Solid::Battery *b = qobject_cast<const Solid::Battery*> (device.asDeviceInterface(Solid::DeviceInterface::Battery));
        if(b->type() == Solid::Battery::PrimaryBattery || b->type() == Solid::Battery::UpsBattery) {
            qDebug() << ":: A battery or UPS has been detected";
            if (b->chargeState() == Solid::Battery::Discharging)
                pu = true;
            break;
        }
    }

    if (pu) {
        int r = KMessageBox::warningContinueCancel(0, i18n("It looks like your power adaptar is unplugged. "
                "Installation is a delicate and lenghty process, hence it is strongly advised to have your "
                "PC connected to AC to minimize possible risks."));
        if (r == KMessageBox::Cancel) {
            return 0;
        }
        qDebug() << ":: The power adapter is unplugged";
    }

    // Load the styleSheet
    QFile file(STYLESHEET_INSTALL_PATH);
    file.open(QFile::ReadOnly);
    QString styleSheet = QLatin1String(file.readAll());

    qApp->setStyleSheet(styleSheet);

    MainWindow mw;

    mw.show();

    return app.exec();
}
コード例 #21
0
ファイル: main.cpp プロジェクト: eliovir/krecipes
int main( int argc, char **argv )
{

	qRegisterMetaType<ElementList>();

	options.add("convert-sqlite3", ki18n("Convert the current SQLite 2.x database to SQLite 3 and exit") , 0 );
	options.add( 0, KLocalizedString(), 0 );    


	KAboutData about( "krecipes", 0, ki18n( "Krecipes" ), version, ki18n( "The KDE Cookbook" ), KAboutData::License_GPL, ki18n( "(C) 2003 Unai Garro\n(C) 2004-2006 Jason Kivlighn"), ki18n("This product is RecipeML compatible.\nYou can get more information about this file format in:\nhttp://www.formatdata.com/recipeml" ), "http://krecipes.sourceforge.net/" );
	about.addAuthor( ki18n("Unai Garro"), KLocalizedString(), "*****@*****.**", 0 );
	about.addAuthor( ki18n("Jason Kivlighn"), KLocalizedString(), "*****@*****.**", 0 );
	about.addAuthor( ki18n("Cyril Bosselut"), KLocalizedString(), "*****@*****.**", "http://b1project.com" );

	about.addCredit( ki18n("Colleen Beamer"), ki18n("Testing, bug reports, suggestions"), "*****@*****.**", 0 );
	about.addCredit( ki18n("Robert Wadley"), ki18n("Icons and artwork"), "*****@*****.**", 0 );
	about.addAuthor( ki18n("Daniel Sauvé"), ki18n("Porting to KDE4"), "*****@*****.**", "http://metres.homelinux.com" );

        about.addAuthor( ki18n("Laurent Montel"), ki18n("Porting to KDE4"), "*****@*****.**", 0 );
        about.addAuthor( ki18n("José Manuel Santamaría Lema"), ki18n("Porting to KDE4, current maintainer"), "*****@*****.**", 0 );
        about.addAuthor( ki18n("Martin Engelmann"), ki18n("Porting to KDE4, developer"), "*****@*****.**", 0 );
	
	about.addCredit( ki18n("Patrick Spendrin"), ki18n("Patches to make Krecipes work under Windows"), "*****@*****.**", 0 );
	about.addCredit( ki18n("Mike Ferguson"), ki18n("Help with bugs, patches"), "", 0 );
	about.addCredit( ki18n("Warren Severin"), ki18n("Code to export recipes to *.mx2 files"), "", 0 );
	
	about.addCredit( ki18n("Eduardo Robles Elvira"),
		ki18n("He advised using WebKit to fix printing support during Akademy-es 2010."),
		"*****@*****.**", 0 );
	about.addCredit( ki18n("José Millán Soto"),
		ki18n("He advised using WebKit to fix printing support during Akademy-es 2010."),
		"", 0 );

	about.setTranslator( ki18n( "INSERT YOUR NAME HERE" ), ki18n( "INSERT YOUR EMAIL ADDRESS" ) );
	KCmdLineArgs::init( argc, argv, &about );
	KCmdLineArgs::addCmdLineOptions( options );
	KUniqueApplication::addCmdLineOptions();

	if ( !KUniqueApplication::start() ) {
		std::cerr << "Krecipes is already running!" << std::endl;
		return 0;
	}

	KUniqueApplication app;

	// see if we are starting with session management
	if ( app.isSessionRestored() ) {
		RESTORE( Krecipes );
	}
	else {
		// no session.. just start up normally
		KCmdLineArgs *args = KCmdLineArgs::parsedArgs();

		QApplication::flush();

		if ( args->isSet("convert-sqlite3") ) {
			ConvertSQLite3 sqliteConverter;
			sqliteConverter.convert();
			return 0;
		}

		Krecipes * widget = new Krecipes;
		app.setTopWidget( widget );
		widget->show();

		args->clear();
	}

	return app.exec();
}
コード例 #22
0
ファイル: main.cpp プロジェクト: RoboMod/network-manager-ipop
int main(int argc, char **argv)
{
    KAboutData aboutData( "networkmanagement_configshell", "libknetworkmanager", ki18n("Network Management"),
                          0,
                          ki18n("Create network connections standalone"),
                          KAboutData::License_GPL,
                          ki18n("(c) 2008 Will Stephenson") );

    aboutData.addAuthor(ki18n("Will Stephenson"), KLocalizedString(), "*****@*****.**");

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

    KCmdLineOptions options;
    options.add("connection <connection-id>", ki18n("Connection ID to edit"));
    options.add("hiddennetwork <ssid>", ki18n("Connect to a hidden wireless network"));
    options.add("type <type>", ki18n("Connection type to create, must be one of '802-3-ethernet', '802-11-wireless', 'pppoe', 'vpn', 'cellular', 'bluetooth'"));
    options.add("specific-args <args>", ki18n("Space-separated connection type-specific arguments, may be either 'gsm' or 'cdma' for cellular connections,\n'openvpn' or 'vpnc' for vpn connections,\ninterface and AP identifiers for wireless connections,\nbluetooth mac address and service ('dun' or 'nap') for bluetooth connections.\n\nYou can also pass the serial device (i.e. 'rfcomm0') instead of service for dun bluetooth connections,\nin that case this program will block waiting for that device to be registered in ModemManager."));
    options.add("+mode", ki18n("Operation mode, may be either 'create' or 'edit'"), "create");
    KCmdLineArgs::addCmdLineOptions( options ); // Add our own options.
    KUniqueApplication app;

    const KCmdLineArgs *args = KCmdLineArgs::parsedArgs();

    if (args->count() < 1)
    {
        args->usage();
        return -1;
    }

    ConnectionEditor editor(0);
    QString specifics = args->getOption("specific-args");
    QString ssid;
    QVariantList specificArgs;

    foreach (const QString& arg, specifics.split( ' ' )) {
        specificArgs << QVariant(arg);
    }

    kDebug(KDE_DEFAULT_DEBUG_AREA) << specificArgs;
    kDebug(KDE_DEFAULT_DEBUG_AREA) << args;
    QTextStream qout(stdout, QIODevice::WriteOnly);

    if (args->arg(0) == QLatin1String("create")) {
        if (args->isSet("type")) {
            const QString type = args->getOption("type");
            Knm::Connection *con = 0;
            if (type == QLatin1String("cellular")) {
                MobileConnectionWizard *mobileConnectionWizard = new MobileConnectionWizard();

                if (mobileConnectionWizard->exec() == QDialog::Accepted &&
                    mobileConnectionWizard->getError() == MobileProviders::Success) {
                    con = editor.createConnection(true, mobileConnectionWizard->type(), mobileConnectionWizard->args(), false);
                }
                delete mobileConnectionWizard;
            }
            /* To create a bluetooth DUN connection:
             * networkmanagement_configshell create --type bluetooth --specific-args "00:11:22:33:44:55 dun"
             *     or
             * networkmanagement_configshell create --type bluetooth --specific-args "00:11:22:33:44:55 rfcomm0"
             *
             * in the latter case networkmanagement_configshell will block waiting for the device rfcomm0 to be
             * registered in ModemManager.
             */
            else if (type == QLatin1String("bluetooth")) {
                if (specificArgs.count() == 2) {
                    new Bluetooth(specificArgs[0].toString(), specificArgs[1].toString());
                    return app.exec();
                } else {
                    qout << i18n("Expected two specific args, found %1: %2", specificArgs.count(), specifics) << "\n"; 
                    return -1;
                }
            } else {
                con = editor.createConnection(true, Knm::Connection::typeFromString(type), specificArgs);
            }

            if (!con) {
                kDebug(KDE_DEFAULT_DEBUG_AREA) << Knm::Connection::typeFromString(type) << "type connection cannot be created.";
                return -1;
            }

            /* TODO: test if connection already exists and in case affirmative do not add it. */
            ManageConnection::saveConnection(con);
            return app.exec();
        } else {
            args->usage();
            return -1;
        }
    } else {
        if (args->isSet("connection")) {
            QString connectionId = args->getOption("connection");
            kDebug(KDE_DEFAULT_DEBUG_AREA) << "Editing connections is not yet implemented";
            return 0;
            // do edit
        } else {
            args->usage();
            return -1;
        }
    }
    return 0;
}
コード例 #23
0
int main(int argc, char **argv)
{
    KAboutData about("kftpgrabber", 0, ki18n("KFTPgrabber"), version, ki18n(description),
                     KAboutData::License_GPL, ki18n("(C) 2008, The KFTPgrabber developers"), KLocalizedString(), "http://www.kftp.org");
    about.addAuthor(ki18n("Jernej Kos"), ki18n("Lead developer"), "*****@*****.**");
    about.addAuthor(ki18n("Markus Brüffer"), ki18n("Developer"), "*****@*****.**");
    
    about.addCredit(ki18n("Lee Joseph"), ki18n("Fedora ambassador responsible for promotion, testing and debugging; also a package maintainer for Fedora-compatible distributions"), "*****@*****.**");
    about.addCredit(ki18n("libssh2 Developers"), ki18n("SSH library"), "*****@*****.**");
    about.addCredit(ki18n("Anthony D. Urso"), ki18n("otpCalc code"));
    about.addCredit(ki18n("Kopete Developers"), ki18n("KopeteBalloon popup code"), "*****@*****.**");
    about.addCredit(ki18n("KSysGuard Developers"), ki18n("Traffic graph widget"), "*****@*****.**");
    about.addCredit(ki18n("Bob Ziuchkovski"), ki18n("Icon design"), "*****@*****.**");
    about.addCredit(ki18n("Tobias Ussing"), ki18n("Testing and debugging"), "*****@*****.**");
    about.addCredit(ki18n("Tim Kosse"), ki18n("Directory parser code"), "*****@*****.**");
    about.addCredit(ki18n("Peter Penz"), ki18n("Listview column handling code"), "*****@*****.**");

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

    KCmdLineOptions options;
    options.add("+[url]", ki18n("An optional URL to connect to"));
    KCmdLineArgs::addCmdLineOptions(options);
    KUniqueApplication app;
    
    if (app.isSessionRestored()) {
      RESTORE(MainWindow);
    } else {
      MainWindow *mainWindow = 0;
      KCmdLineArgs *args = KCmdLineArgs::parsedArgs();

      KSplashScreen *splash = 0L;
      QString splashPath = KStandardDirs::locate("appdata", "kftpgrabber-logo.png");
      if (!KFTPCore::Config::startMinimized() && KFTPCore::Config::showSplash()) {
        // Show the splash screen
        if (!splashPath.isNull()) {
          QPixmap splashImage = QPixmap(splashPath);
          splash = new KSplashScreen(splashImage);
          splash->setMaximumWidth(400);
          splash->show();
        }
      }
      
      mainWindow = new MainWindow();
      if (!KFTPCore::Config::startMinimized())
        mainWindow->show();
        
      // Check if an URL was passed as a command line argument
      if (args->count() == 1) {
        KUrl remoteUrl = args->url(0);
        
        if (!remoteUrl.isLocalFile()) {
          if (!remoteUrl.port())
            remoteUrl.setPort(21);
            
          if (!remoteUrl.hasUser())
            remoteUrl.setUser("anonymous");
            
          if (!remoteUrl.hasPass()) {
            if (!KFTPCore::Config::anonMail().isEmpty())
              remoteUrl.setPass(KFTPCore::Config::anonMail());
            else
              remoteUrl.setPass("*****@*****.**");
          }

          KFTPSession::Manager::self()->spawnRemoteSession(KFTPSession::IgnoreSide, remoteUrl);
        }
      }
        
      if (splash != 0L) {
        splash->finish(mainWindow);
        delete splash;
      }
      
      args->clear();
    }
    
    return app.exec();
}
コード例 #24
0
ファイル: main.cpp プロジェクト: KDE/kde-runtime
extern "C" KDE_EXPORT int kdemain(int argc, char **argv)
    {
    // Disable Session Management the right way (C)
    //
    // ksmserver has global shortcuts. disableSessionManagement() does not prevent Qt from
    // registering the app with the session manager. We remove the address to make sure we do not
    // get a hang on kglobalaccel restart (kglobalaccel tries to register with ksmserver,
    // ksmserver tries to register with kglobalaccel).
    unsetenv( "SESSION_MANAGER" );
#ifdef Q_OS_MAC
    CFBundleRef mainBundle = CFBundleGetMainBundle();
    if (mainBundle) {
        // get the application's Info Dictionary. For app bundles this would live in the bundle's Info.plist,
        // for regular executables it is obtained in another way.
        CFMutableDictionaryRef infoDict = (CFMutableDictionaryRef) CFBundleGetInfoDictionary(mainBundle);
        if (infoDict) {
            // Add or set the "LSUIElement" key with/to value "1". This can simply be a CFString.
            CFDictionarySetValue(infoDict, CFSTR("LSUIElement"), CFSTR("1"));
            // That's it. We're now considered as an "agent" by the window server, and thus will have
            // neither menubar nor presence in the Dock or App Switcher.
        }
    }
#endif

    KAboutData aboutdata(
            "kglobalaccel",
            0,
            ki18n("KDE Global Shortcuts Service"),
            "0.2",
            ki18n("KDE Global Shortcuts Service"),
            KAboutData::License_LGPL,
            ki18n("(C) 2007-2009  Andreas Hartmetz, Michael Jansen"));
    aboutdata.addAuthor(ki18n("Andreas Hartmetz"),ki18n("Maintainer"),"*****@*****.**");
    aboutdata.addAuthor(ki18n("Michael Jansen"),ki18n("Maintainer"),"*****@*****.**");

    aboutdata.setProgramIconName("kglobalaccel");

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

    // check if kglobalaccel is disabled
    if (!isEnabled())
        {
        kDebug() << "kglobalaccel is disabled!";
        return 0;
        }

    if (!KUniqueApplication::start())
        {
        kDebug() << "kglobalaccel is already running!";
        return (0);
        }

    // As in the KUniqueApplication example only create a instance AFTER
    // calling KUniqueApplication::start()
    KUniqueApplication app;

    // This app is started automatically, no need for session management
    app.disableSessionManagement();
    app.setQuitOnLastWindowClosed( false );

    // Stop gracefully
    //There is no SIGINT and SIGTERM under wince
#ifndef _WIN32_WCE
    KDE_signal(SIGINT, sighandler);
    KDE_signal(SIGTERM, sighandler);
#endif
    KDE_signal(SIGHUP, sighandler);

    // Restart on a crash
    KCrash::setFlags(KCrash::AutoRestart);

    KGlobalAccelD globalaccel;
    if (!globalaccel.init()) {
        return -1;
    }

    return app.exec();
    }