示例#1
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();
}
示例#2
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();
}
示例#3
0
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();
}
示例#4
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();
}
示例#5
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();
    }