コード例 #1
0
ファイル: kpopuptest.cpp プロジェクト: vasi/kdelibs
int main(int argc, char **argv)
{
    KCmdLineArgs::init( argc, argv, "test", 0, ki18n("Test"), "1.0", ki18n("test app"));
    KApplication app;
    DemoWidget w;
    w.setFont(QFont("helvetica", 12, QFont::Bold));
    w.show();
    return app.exec();
}
コード例 #2
0
ファイル: testmanager.cpp プロジェクト: serghei/kde3-kdepim
int main(int argc, char **argv)
{
    KCmdLineArgs::init(argc, argv, "test", "test", "test", "0.1");
    KApplication app;

    TestManager manager(&app);

    return app.exec();
}
コード例 #3
0
int main(int argc, char **argv)
{
    KApplication *app = new KApplication(argc, argv, "KGradientTest");
    KGradientWidget w;
    w.resize(250 * cols, 250 * rows);
    app->setMainWidget(&w);
    w.show();
    return(app->exec());
}
コード例 #4
0
ファイル: ktabwidgettest.cpp プロジェクト: fluxer/kdelibs
int main(int argc, char** argv )
{
    KCmdLineArgs::init(argc, argv, "ktabwidgettest", 0, ki18n("KTabWidgetTest"), "1.0", ki18n("ktabwidget test app"));
    //KApplication::disableAutoDcopRegistration();
    KApplication app;
    Test *t = new Test();
    t->show();
    app.exec();
}
コード例 #5
0
ファイル: sendqueued.cpp プロジェクト: pvuorela/kcalcore
int main( int argc, char **argv )
{
  KCmdLineArgs::init( argc, argv, "sendqueued", 0,
                      ki18n( "sendqueued" ), "0",
                      ki18n( "An app that sends all queued messages" ) );
  KApplication app;
  new Runner();
  return app.exec();
}
コード例 #6
0
ファイル: kapplication.cpp プロジェクト: fluxer/kdelibs
/*
  Auxiliary function to calculate a a session config name used for the
  instance specific config object.
  Syntax:  "session/<appname>_<sessionId>"
 */
QString KApplicationPrivate::sessionConfigName() const
{
#ifdef QT_NO_SESSIONMANAGER
#error QT_NO_SESSIONMANAGER was set, this will not compile. Reconfigure Qt with Session management support.
#endif
    QString sessKey = q->sessionKey();
    if ( sessKey.isEmpty() && !sessionKey.isEmpty() )
        sessKey = sessionKey;
    return QString(QLatin1String("session/%1_%2_%3")).arg(q->applicationName()).arg(q->sessionId()).arg(sessKey);
}
コード例 #7
0
ファイル: main.cpp プロジェクト: BackupTheBerlios/fedge-svn
int main(int argc, char **argv)
{
    KAboutData about("fedge", I18N_NOOP("fedge"), version, description, KAboutData::License_GPL, "(C) 2004 mkulke", 0, 0, "[email protected]");
    about.addAuthor( "mkulke", 0, "[email protected]" );
    KCmdLineArgs::init(argc, argv, &about);
    KCmdLineArgs::addCmdLineOptions(options);
    KApplication app;
	 app.setMainWidget(new Fedge());
    return app.exec();
}
コード例 #8
0
ファイル: kselectactiontest.cpp プロジェクト: vasi/kdelibs
int main( int argc, char **argv )
{
    KCmdLineArgs::init( argc, argv, "kselectactiontest", 0, ki18n("KSelectActionTest"), "1.0", ki18n("kselectaction test app"));
    KApplication app;

    SelectActionTest* test = new SelectActionTest;
    test->show();

    return app.exec();
}
コード例 #9
0
ファイル: main.cpp プロジェクト: jsj2008/kdegames
int main(int argc, char *argv[])
{
	KAboutData about("kiriki", 0, ki18n("Kiriki"), "0.2", ki18n("A Yahtzee dice game for KDE"), KAboutData::License_GPL, ki18n("© 2005-2007 Albert Astals Cid"), KLocalizedString(), "http://games.kde.org/kiriki" );
	about.addAuthor(ki18n("Albert Astals Cid"), KLocalizedString(), "[email protected]");
	KCmdLineArgs::init(argc, argv, &about);
	KApplication app;
	KGlobal::locale()->insertCatalog( QLatin1String( "libkdegames" ));
	app.setTopWidget(new kiriki());
	return app.exec();
}
コード例 #10
0
ファイル: main.cpp プロジェクト: KDE/ksnapshot
int main(int argc, char **argv)
{
  KAboutData aboutData( "ksnapshot", 0, ki18n("KSnapshot"),
    KSNAPVERSION, ki18n(description), KAboutData::License_GPL,
    ki18n("(c) 1997-2008, Richard J. Moore,\n(c) 2000, Matthias Ettrich,\n(c) 2002-2003 Aaron J. Seigo"));
  aboutData.addAuthor(ki18n("Richard J. Moore"),KLocalizedString(), "[email protected]");
  aboutData.addAuthor(ki18n("Matthias Ettrich"),KLocalizedString(), "[email protected]");
  aboutData.addAuthor(ki18n("Aaron J. Seigo"), KLocalizedString(), "[email protected]");
  aboutData.addCredit( ki18n("Nadeem Hasan"), ki18n("Region Grabbing\nReworked GUI"),
      "[email protected]" );
  aboutData.addCredit( ki18n("Marcus Hufgard"), ki18n("\"Open With\" function"),
      "[email protected]" );
  aboutData.addCredit( ki18n("Pau Garcia i Quiles"), ki18n("Free region grabbing, KIPI plugins support, port to Windows"),
      "[email protected]" );

  KCmdLineArgs::init( argc, argv, &aboutData );
  KCmdLineArgs::addCmdLineOptions( ksnapshot_options() ); // Add our own options.
  KCmdLineArgs *args = KCmdLineArgs::parsedArgs();

  // This is one of the applications that requires the "native" / X11 graphics backend to work.
  QApplication::setGraphicsSystem("native");
  KApplication app;

  // Create top level window
  KSnapshot *toplevel;
  bool showTopLevel = false;

  if ( args->isSet( "current" ) )
     toplevel = new KSnapshot( 0, KSnapshotObject::WindowUnderCursor );
  else if(args->isSet( "fullscreen" ))
  {
     //we grad directly desktop => show dialogbox
     showTopLevel = true;
     toplevel = new KSnapshot( 0, KSnapshotObject::FullScreen );
  }
  else if(args->isSet( "region" ))
     toplevel = new KSnapshot( 0, KSnapshotObject::Region );
  else if(args->isSet( "freeregion" ))
     toplevel = new KSnapshot( 0, KSnapshotObject::FreeRegion );
  else if(args->isSet( "child" ))
     toplevel = new KSnapshot( 0, KSnapshotObject::ChildWindow );
  else
  {
     showTopLevel = true;
     toplevel = new KSnapshot();
  }

  args->clear();
  new KsnapshotAdaptor(toplevel);
  QDBusConnection::sessionBus().registerObject("/KSnapshot", toplevel);

  if(showTopLevel)
     toplevel->show();
  return app.exec();
}
コード例 #11
0
ファイル: main.cpp プロジェクト: acpanna/coding
int main(int argc, char **argv)
{
  QString aboutText("KDE und Qt Programmierung\n(c) Addison-Wesley");
  KCmdLineArgs::init(argc, argv, "khelloworld", aboutText, "1.0");
  KApplication app;

  MyMainWindow *top = new MyMainWindow();
  top->show();

  return app.exec();
}
コード例 #12
0
ファイル: kcomboboxtest.cpp プロジェクト: vasi/kdelibs
int main ( int argc, char **argv)
{
  KAboutData about("kcomboboxtest", 0, ki18n("kcomboboxtest"), "version");
  KCmdLineArgs::init(argc, argv, &about);

  KApplication a;

  KComboBoxTest* t= new KComboBoxTest;
  t->show ();
  return a.exec();
}
コード例 #13
0
ファイル: khboxtest.cpp プロジェクト: vasi/kdelibs
int main( int argc, char ** argv )
{
    KAboutData about("KHBoxTest", 0, ki18n("KHBoxTest"), "version");
    KCmdLineArgs::init(argc, argv, &about);

    KApplication app;

    KHBoxTest *toplevel = new KHBoxTest(0);
    toplevel->show();
    app.exec();
}
コード例 #14
0
PhotoLayoutsEditor * PhotoLayoutsEditor::instance(QWidget * parent)
{
    if (m_instance)
        return m_instance;
    else
    {
        KApplication * app = KApplication::kApplication();
        app->installEventFilter(new UndoCommandEventFilter(app));
        return (m_instance = new PhotoLayoutsEditor(parent));
    }
}
コード例 #15
0
ファイル: kpagewidgettest.cpp プロジェクト: vasi/kdelibs
int main( int argc, char **argv )
{
  KAboutData about("KPageWidgetTest", 0, ki18n("KPageWidgetTest"), "version");
  KCmdLineArgs::init( argc, argv, &about );

  KApplication app;

  KPageWidgetTest testWidget( 0 );
  testWidget.show();

  return app.exec();
}
コード例 #16
0
ファイル: kmodifierkeyinfotest.cpp プロジェクト: vasi/kdelibs
int main(int argc, char *argv[])
{
    KAboutData about("simple", "simple", ki18n("simple"),
                     "0.0.1");
    KCmdLineArgs::init(argc, argv, &about);

    KApplication app;
    TestWidget mainWidget;
    mainWidget.show();

    return app.exec();
}
コード例 #17
0
int main( int argc, char **argv )
{
  KCmdLineArgs::init( argc, argv, "test", 0, ki18n("Test"), "1.0", ki18n("test app"));
  KApplication app;

  KGlobal::mainComponent().dirs()->addResourceDir( "data", "." );

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

  return app.exec();
}
コード例 #18
0
ファイル: kwalletmany.cpp プロジェクト: fluxer/kde-workspace
int main(int argc, char *argv[])
{
	KAboutData aboutData("kwalletmany", 0, ki18n("kwalletmany"), "version");
	KCmdLineArgs::init(argc, argv, &aboutData);
	KApplication app;
	KWalletMany m;
	
	QTimer::singleShot(0, &m, SLOT(openWallet()));
	QTimer::singleShot(30000, &m, SLOT(quit()));
	
	return app.exec();
}
コード例 #19
0
ファイル: main.cpp プロジェクト: mikolajs/milionaire
int main ( int argc, char **argv ) {
  KAboutData about ( "kmilion", 0, ki18n ( "KMilion" ), version, ki18n ( description ),
                     KAboutData::License_GPL, ki18n ( "(C) 2010 Mikołaj Sochacki" ), KLocalizedString(), 0, "[email protected]" );
  about.addAuthor ( ki18n ( "Mikołaj Sochacki" ), KLocalizedString(), "[email protected]" );
  KCmdLineArgs::init ( argc, argv, &about );

  KCmdLineOptions options;
  options.add ( "+[URL]", ki18n ( "Document to open" ) );
  KCmdLineArgs::addCmdLineOptions ( options );
  KApplication app;
  
  KMilion *widget = new KMilion;
  const QRect r = app.desktop()->frameGeometry();
  widget->setScreenSize ( r.width(), r.height() );
  KCmdLineArgs *args;
  if ( app.isSessionRestored() ) {
      RESTORE ( KMilion );
    }
  else {
      args = KCmdLineArgs::parsedArgs();
      widget->show();
    }
  args->clear();

  // Tak jest w orginale nie mam pojęcia dlaczego? Szczególnie po co kilka razy show!
  //see if we are starting with session management
//     if (app.isSessionRestored())
//     {
//         RESTORE(KMilion);
//     }
//     else
//     {
//         // no session.. just start up normally
//         KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
//         if (args->count() == 0)
//         {
//             //kmilion *widget = new kmilion;
//             widget->show();
//         }
//         else
//         {
//             int i = 0;
//             for (; i < args->count(); i++)
//             {
//                 //kmilion *widget = new kmilion;
//                 widget->show();
//             }
//         }
//         args->clear();
//     }

  return app.exec();
}
コード例 #20
0
ファイル: kcemirror.cpp プロジェクト: asmblur/SynCE
int main(int argc, char *argv[])
{
    KAboutData aboutData("kcemirror", I18N_NOOP("KCeMirror"), VERSION, description,
            KAboutData::License_Custom,
            "(c) 2003, Volker Christian (voc)", 0,
            "http://synce.sourceforge.net/synce/kde/",
            "[email protected]");
    aboutData.addAuthor("Volker Christian", 0, "[email protected]");
    aboutData.addCredit("Ludovic Lange",
            I18N_NOOP("is the Initiator of the SynCE-Project."),
            "[email protected]");
    aboutData.addCredit("David Eriksson",
            I18N_NOOP("is the current Project Manager."),
            "[email protected]");
    aboutData.addCredit("Ganesh Varadarajan",
            I18N_NOOP("has developed the serial-over-USB driver."),
            "[email protected]");
    aboutData.setLicenseText(MITlicense);

    KCmdLineArgs::init( argc, argv, &aboutData );
    KCmdLineArgs::addCmdLineOptions( options );
    KApplication::addCmdLineOptions();

    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();

    QString pdaName = args->arg(0);
    bool synce = args->isSet("synce");
    bool forceInstall = args->isSet("forceinstall");

    kdDebug(2120) << "Synce: " << synce << endl;
    kdDebug(2120) << "ForceInstall: " << forceInstall << endl;

#if KDE_VERSION < KDE_MAKE_VERSION(3,2,0) // KDE-3.1
    KApplication a(argc, argv, QCString("kcemirror"));
#else
    KApplication a;
#endif

    CeScreen *ceScreen = new CeScreen();

    QObject::connect(ceScreen, SIGNAL(pdaError()), &a, SLOT(quit()));

    if (!ceScreen->connectPda(pdaName, synce, forceInstall)) {
        kdDebug(2120) << "Could not contact PDA " << pdaName << endl;
        return -1;
    }

    a.setMainWidget(ceScreen);

    ceScreen->show();

    return a.exec();
}
コード例 #21
0
ファイル: main.cpp プロジェクト: serghei/kde3-kdewebdev
int main(int argc, char *argv[])
{

    KAboutData aboutData( "kimagemapeditor", I18N_NOOP("KImageMapEditor"),
                          VERSION, description, KAboutData::License_GPL,
                          "(C) 2001-2008 Jan Schaefer", 0, "http://www.nongnu.org/kimagemap/", "[email protected]");
    aboutData.addAuthor("Jan Schaefer",0, "[email protected]");
    aboutData.addCredit("Joerg Jaspert",I18N_NOOP("For helping me with the Makefiles, and creating the Debian package"));
    aboutData.addCredit("Aaron Seigo and Michael",I18N_NOOP("For helping me fixing --enable-final mode"));
    aboutData.addCredit("Antonio Crevillen",I18N_NOOP("For the Spanish translation"));
    aboutData.addCredit("Fabrice Mous",I18N_NOOP("For the Dutch translation"));
    aboutData.addCredit("Germain Chazot",I18N_NOOP("For the French translation"));
    KCmdLineArgs::init( argc, argv, &aboutData );
    KCmdLineArgs::addCmdLineOptions( options ); // Add our own options.

    KApplication a;
    a.dcopClient()->registerAs(a.name());



    if (a.isRestored())
    {
        RESTORE(KimeShell);
    }
    else
    {
        KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
        if ( args->count() == 0 )
        {
            KimeShell *kimeShell = new KimeShell();
            kimeShell->setStdout(args->isSet("stdout"));
            kimeShell->readConfig();
            kimeShell->show();
            kimeShell->openLastFile();
        }
        else
        {
            int i = 0;
            for (; i < args->count(); i++ )
            {
                KimeShell *kimeShell = new KimeShell();
                kimeShell->setStdout(args->isSet("stdout"));
                kimeShell->readConfig();
                kimeShell->show();
                kimeShell->openFile(args->url(i));
            }
        }
        args->clear();
    }

    return a.exec();
}
コード例 #22
0
ファイル: main.cpp プロジェクト: detaos/projekt7
int main(int argc, char* argv[]) {
	KAboutData aboutData("projekt7", "projekt7",
						 ki18n("Projekt 7"), "0.9.9",
						 ki18n("The best damn music player ever made!"),
						 KAboutData::License_GPL_V3,
						 ki18n("Copyright (c) 2011 Rick Battle <[email protected]>"));
	
	KCmdLineArgs::init(argc, argv, &aboutData);
	KApplication app;
	Player* player = new Player();
	player->show();
	return app.exec();
}
コード例 #23
0
int main( int argc, char** argv )
{
    KApplication::disableAutoDcopRegistration();
    KCmdLineArgs::init(argc, argv, "storedroptest", 0, 0, 0, 0);
    KApplication app;

    StoreDropTest* window = new StoreDropTest( 0 );
    window->resize( 500, 500 );
    window->show();

    QObject::connect( qApp, SIGNAL( lastWindowClosed() ), qApp, SLOT( quit() ) );
    return app.exec();
}
コード例 #24
0
int main( int argc, char** argv )
{
    //KApplication::disableAutoDcopRegistration();
    KCmdLineArgs::init( argc, argv, "test_dialog", 0, ki18n("test_dialog"), 0);
    KApplication app; // with GUI

    TestDialog test;
    test.check( "This is a sample buffer. Whih this thingg will "
                "be checkin for misstakes. Whih, Enviroment, govermant. Whih."
        );

    return app.exec();
}
コード例 #25
0
int main(int argc,char** argv)
{
	Globals::instance().setDebugMode(true);
	KAboutData about("ktupnptest", I18N_NOOP("KTUPnPTest"), version, description,
					 KAboutData::License_GPL, "(C) 2005 Joris Guisson", 0,
					 "http://ktorrent.org/");
	KCmdLineArgs::init(argc, argv,&about);
	KCmdLineArgs::addCmdLineOptions( options );
	KApplication app;
	Globals::instance().initLog(kt::DataDir() + "ktupnptest.log");
	UPnPTestApp* mwnd = new UPnPTestApp();

	app.setMainWidget(mwnd);
	mwnd->show();
	app.exec();
	Globals::cleanup();
	return 0;
	
	/*
	if (argc >= 2)
	{
		kt::UPnPRouter router(QString::null,"http://foobar.com");
		kt::UPnPDescriptionParser dp;
		
		if (!dp.parse(argv[1],&router))
		{
			Out() << "Cannot parse " << QString(argv[1]) << endl;
		}
		else
		{
			Out() << "Succesfully parsed the UPnP contents" << endl;
			router.debugPrintData();
		}
	}
	
	
	Out() << "Doing second test" << endl;
	UPnPMCastSocket mcast;
	UPnPRouter* r = mcast.parseResponse(QCString(test_ps));
	if (r)
	{
		Out() << "Succesfully parsed test_ps" << endl;
		delete r;
	}
	else
	{
		Out() << "Failed to parse test_ps" << endl;
	}
	*/
	
}
コード例 #26
0
int main(int argc, char** argv)
{
    qInstallMsgHandler(messageOutput);
    KAboutData aboutData( "duchaintokross", 0, ki18n( "duchaintokross" ),
                          "33", ki18n("Wrapper generator from C++ to Kross"), KAboutData::License_GPL,
                          ki18n( "(c) 2008, The KDevelop developers" ), KLocalizedString(), "http://www.kdevelop.org" );
    KCmdLineArgs::init( argc, argv, &aboutData );
    KCmdLineOptions options;
    options.add("+file", ki18n("input .cpp file"), QByteArray());
    options.add("I <includes>", ki18n("include directories for the parser (colon separated)"), QByteArray());
    options.add("i <includes>", ki18n("include directories that the generated implementation file will have (colon separated)"), QByteArray());
    options.add("b <builddir>", ki18n("build dir where the Makefile for the input is added"), QByteArray());
    options.add("F <filename>", ki18n("filename to be used for the .moc and the .h file"), QByteArray());
    options.add("D <directory>", ki18n("directory where to put the .h output"), QByteArray());
    options.add("o <output>", ki18n("directory where to put the code output"), QByteArray());
    options.add("impl", ki18n("create implementation"), QByteArray());
    options.add("verbose", ki18n("Verbose output"), QByteArray());
    KCmdLineArgs::addCmdLineOptions( options );
    
    KApplication app;
    ConsoleIDEExtension::init();
    Core::initialize(0, Core::NoUi);
    
    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
    KUrl::List includes;
    KUrl input;
    
    for(int i=0; i<args->count(); i++)
    {
        QString arg=args->arg(i);
        input=KUrl(arg);
    }
    
    foreach(const QString& inc, args->getOption("I").split(':'))
        includes << KUrl(inc);
    KUrl builddir(args->getOption("b"));
    QString filename(args->getOption("F"));
    QString directory(args->getOption("D"));
    QStringList toinclude(args->getOption("i").split(':'));
    QString output(args->getOption("o"));
    verbose=args->isSet("verbose");
    bool createImpl=args->isSet("impl");
    args->clear();
    
    DUChainExtractor e;
    kDebug() << input << builddir << includes << toinclude;
    e.setWriteImpl(createImpl);
    e.start(input, builddir, includes, filename, directory, toinclude, output);
    
    return app.exec();
}
コード例 #27
0
ファイル: main.cpp プロジェクト: iegor/kdesktop
int main( int argc, char** argv )
{
  KAboutData aboutData( "kdat", I18N_NOOP("KDat"), 
    KDAT_VERSION, description, KAboutData::License_GPL, 
    "(c) 1999-2000, Sean Vyain; 2001-2002 Lawrence Widman");

  /* 2002-01-28 LEW: so we can dump core if we want to */
  // KCrash::setCrashHandler(0);  // this is supposed to work, but it doesn't
#ifdef DEBUG
  {
    char *newarg;
    if( ( newarg = (char *)malloc( strlen("--nocrashhandler") + 1 ) ) == NULL )
      {
	KMessageBox::sorry(NULL, i18n("Can't allocate memory in kdat"));
        exit(1);
      }
    strcpy( newarg, "--nocrashhandler" );
    argv[ argc ] = newarg;
    argc++;
  }
  {
    int i;
    for(i=0; i<argc; i++){
      printf("Arg %d: %s\n", i, argv[i]);
    }
  }
#endif /* DEBUG */
  /* 2002-01-28 LEW */

  KCmdLineArgs::init( argc, argv, &aboutData );
  aboutData.addAuthor( "Lawrence Widman", 0, "[email protected]");
//  KCmdLineArgs::addCmdLineOptions( options ); // Add our own options.
  KApplication app;
  
  app.setMainWidget( KDatMainWindow::getInstance() );

  /* set up error handler so we don't crash without notice */
  signal(SIGHUP,  error_handler);
  signal(SIGINT,  error_handler);
  signal(SIGFPE,  error_handler);
  signal(SIGSEGV, error_handler);
  signal(SIGTERM, error_handler);   

  if ( app.isRestored() && KDatMainWindow::canBeRestored( 1 ) ) {
    KDatMainWindow::getInstance()->restore( 1 );
  } else {
    KDatMainWindow::getInstance()->show();
  }

  return app.exec();
}
コード例 #28
0
ファイル: kxsconfig.cpp プロジェクト: Fat-Zer/kdeartwork
int main(int argc, char *argv[])
{
  KCmdLineArgs::init(argc, argv, appName, I18N_NOOP("KXSConfig"), description, version);

  KCmdLineArgs::addCmdLineOptions(options);

  KApplication app;

  KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
  if(args->count()==0)
    exit(1);

  /* We must read exactly the same resources as xscreensaver.
     That means we must have both the same progclass *and* progname,
     at least as far as the resource database is concerned.  So,
     put "xscreensaver" in argv[0] while initializing Xt.
   */
  const char *dummyargs[] = { "xscreensaver" };
  int dummyargc = 1;
  progname = dummyargs[0];

  // Teach Xt to use the Display that TQt has already opened.
  XtToolkitInitialize ();
  XtAppContext xtApp = XtCreateApplicationContext ();
  Display *dpy = qt_xdisplay();
  XtAppSetFallbackResources (xtApp, const_cast<char**>(defaults));
  XtDisplayInitialize (xtApp, dpy, progname, progclass, 0, 0,
                       &dummyargc,
                       const_cast<char**>(dummyargs));
  Widget toplevel_shell = XtAppCreateShell (progname, progclass,
	  applicationShellWidgetClass,
	  dpy, 0, 0);
  dpy = XtDisplay (toplevel_shell);
  db = XtDatabase (dpy);
  XtGetApplicationNameAndClass (dpy, const_cast<char**>(&progname),
                                const_cast<char**>(&progclass));

  TQString name = TQString::fromLocal8Bit(args->arg(args->count() - 1));
  KXSConfigDialog *dialog=new KXSConfigDialog(args->arg(0), name);
  if ( dialog->create() ) {
      dialog->show();
      app.setMainWidget(dialog);
      app.exec();
  } else {
      KMessageBox::sorry(0,
	      i18n("No configuration available for %1").tqarg(name),
	      name );
  }

  delete dialog;
}
コード例 #29
0
ファイル: main.cpp プロジェクト: KDE/kmplayer
extern "C" KDE_EXPORT int kdemain (int argc, char *argv[]) {
    setsid ();

    KAboutData aboutData ("kmplayer", 0, ki18n("KMPlayer"),
            KMPLAYER_VERSION_STRING,
            ki18n ("Media player."),
            KAboutData::License_GPL,
            ki18n ("(c) 2002-2009, Koos Vriezen"),
            KLocalizedString(),
            I18N_NOOP ("http://kmplayer.kde.org"));
    aboutData.addAuthor(ki18n("Koos Vriezen"), ki18n("Maintainer"),"[email protected]");
    KCmdLineArgs::init (argc, argv, &aboutData);
    KCmdLineOptions options;
    options.add ("+[File]", ki18n ("file to open"));
    KCmdLineArgs::addCmdLineOptions (options);

    KMPlayer::Ids::init();

    KApplication app;
    QPointer <KMPlayerApp> kmplayer;

    if (app.isSessionRestored ()) {
        RESTORE (KMPlayerApp);
    } else {
        kmplayer = new KMPlayerApp ();
        kmplayer->show();

        KCmdLineArgs *args = KCmdLineArgs::parsedArgs();

        KUrl url;
        if (args->count () == 1)
            url = args->url (0);
        if (args->count () > 1)
            for (int i = 0; i < args->count (); i++) {
                KUrl url = args->url (i);
                if (url.url ().indexOf ("://") < 0)
                    url = KUrl (QFileInfo (url.url ()).absoluteFilePath ());
                if (url.isValid ())
                    kmplayer->addUrl (url);
            }
        kmplayer->openDocumentFile (url);
        args->clear ();
    }
    int retvalue = app.exec ();

    delete kmplayer;

    KMPlayer::Ids::reset();

    return retvalue;
}
コード例 #30
0
ファイル: main.cpp プロジェクト: serghei/kde3-kdebase
extern "C" int KDE_EXPORT kdemain(int argc, char *argv[])
{
    KCmdLineArgs::init(argc, argv, "kprinter", I18N_NOOP("KPrinter"), I18N_NOOP("A printer tool for KDE"), "0.0.1");
    KCmdLineArgs::addCmdLineOptions(options);
    KApplication app;
    PrintWrapper *wrap = new PrintWrapper;
    app.setMainWidget(wrap);
    QTimer::singleShot(10, wrap, SLOT(slotPrint()));

    int result = app.exec();
    delete wrap;

    return result;
}