예제 #1
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;
}
예제 #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
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;
}
예제 #4
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();
}
예제 #5
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();
}
예제 #6
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();
    }