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


C++ KUniqueApplication类代码示例

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


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

示例1: kdemain

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"), "[email protected]");
    aboutdata.addAuthor("Christian Esken", 0, "[email protected]");
    aboutdata.addAuthor("Stefan Westerfeld", I18N_NOOP("Sound support"), "[email protected]");
    aboutdata.addAuthor("Charles Samuels", I18N_NOOP("Previous Maintainer"), "[email protected]");

    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;
}
开发者ID:,项目名称:,代码行数:35,代码来源:

示例2: main

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, "[email protected]");
	lAbout.addAuthor(ki18n("Simon Persson"), KLocalizedString(), "[email protected]");
	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();
}
开发者ID:kcroot,项目名称:Kup,代码行数:31,代码来源:main.cpp

示例3: kdemain

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"), "[email protected]");
    aboutdata.addAuthor(ki18n("Rafael Fernández López"), ki18n("Former Maintainer"), "[email protected]");
    aboutdata.addAuthor(ki18n("David Faure"), ki18n("Former maintainer"), "[email protected]");
    aboutdata.addAuthor(ki18n("Matej Koss"), ki18n("Developer"), "[email protected]");

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

示例4: main

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, "[email protected]");
    aboutData.addAuthor("Gerardo Puga", I18N_NOOP("Current maintainer"), "[email protected]"); 
    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();
}
开发者ID:,项目名称:,代码行数:25,代码来源:

示例5: startApp

int startApp( void )
{
	if( KUniqueApplication::start() ){
		KUniqueApplication a ;
		qCheckGMail w;
		w.start();
		return a.exec();
	}else{
		return qCheckGMail::instanceAlreadyRunning() ;
	}
}
开发者ID:Miestro,项目名称:qCheckGMail,代码行数:11,代码来源:main.cpp

示例6: main

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

示例7: main

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

示例8: main

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"),
				"[email protected]");
	aboutData.setProgramIconName("preferences-system-bluetooth");
	KUniqueApplication app;
	app.setQuitOnLastWindowClosed(false);
	MainWindow window;
	return app.exec();
}
开发者ID:jcaden,项目名称:BlueZ-Manager,代码行数:18,代码来源:main.cpp

示例9: main

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();
}
开发者ID:chusopr,项目名称:kdepim-ktimetracker-akonadi,代码行数:21,代码来源:main.cpp

示例10: main

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"),"[email protected]");
    aboutdata.addAuthor(ki18n("Carsten Pfeiffer"),ki18n("Previous Maintainer"),"[email protected]");
    aboutdata.addAuthor(ki18n("Christian Esken"),KLocalizedString(),"[email protected]");
    aboutdata.addAuthor(ki18n("Stefan Westerfeld"),ki18n("Sound support"),"[email protected]");
    aboutdata.addAuthor(ki18n("Charles Samuels"),ki18n("Previous Maintainer"),"[email protected]");
    aboutdata.addAuthor(ki18n("Allan Sandfeld Jensen"),ki18n("Porting to KDE 4"),"[email protected]");

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

示例11: main

int main(int argc, char **argv)
{
	KAboutData about("konference", I18N_NOOP("konference"), version, description,
	                 KAboutData::License_GPL, "(C) 2005 Malte Boehme", 0, 0, "[email protected]");
	about.addAuthor( "Malte Boehme", 0, "[email protected]" );
	about.addCredit( "Paul Volkaerts","MythPhone (i took the codec-, sip-, webcam- and rtp-code)", "[email protected]");
	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();
}
开发者ID:BackupTheBerlios,项目名称:konference-svn,代码行数:40,代码来源:main.cpp

示例12: main

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, "[email protected]");
    about.addAuthor( "Rene Schmidt", 0, "[email protected]" );

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

示例13: main

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

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

    KUniqueApplication app;

    MainWindow window;
    window.show();

    return app.exec();
}
开发者ID:KDE,项目名称:nepomuk-core,代码行数:23,代码来源:main.cpp

示例14: main

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

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

示例15: kdemain

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

    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();
}
开发者ID:Fat-Zer,项目名称:tdebase,代码行数:24,代码来源:kcontrol_main.cpp


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