コード例 #1
0
int main(int argc, char *argv[])
{
    QScopedPointer<KAboutData> aboutData(
        Gwenview::createAboutData(
            "gwenview",       /* appname */
            0,                /* catalogName */
            ki18n("Gwenview") /* programName */
        ));
    aboutData->setShortDescription(ki18n("An Image Viewer"));

    KCmdLineArgs::init(argc, argv, aboutData.data());

    KCmdLineOptions options;
    options.add("f", ki18n("Start in fullscreen mode"));
    options.add("s", ki18n("Start in slideshow mode"));
    options.add("+[file or folder]", ki18n("A starting file or folder"));
    KCmdLineArgs::addCmdLineOptions(options);

    KApplication app;
    Gwenview::ImageFormats::registerPlugins();

    // startHelper must live for the whole life of the application
    StartHelper startHelper;
    if (app.isSessionRestored()) {
        kRestoreMainWindows<Gwenview::MainWindow>();
    } else {
        startHelper.createMainWindow();
    }
    return app.exec();
}
コード例 #2
0
ファイル: main.cpp プロジェクト: chani3/xsmp-test
int main(int argc, char**argv) {
    kDebug() << "hello world";
    
    KAboutData ad(  "asdf",
                         0,
                         ki18n("asdf"),
                         "1.0",
                         ki18n("asdf"),
                         KAboutData::License_GPL,
                         ki18n("(c) 2007")
		 );
    
    KCmdLineArgs::init( argc, argv, &ad );
    KApplication app;
    
    QWidget window;
    QLabel label("hello world");
    QLineEdit edit("edit me");
    QVBoxLayout box(&window);
    box.addWidget(&label);
    box.addWidget(&edit);
    window.show();
    
    return app.exec();
}
コード例 #3
0
ファイル: main.cpp プロジェクト: jamelo/fraktal
int main(int argc, char** argv)
{
    KAboutData aboutData(
        "fractal-viewer",
        0,
        ki18n("Fractal Viewer"),
        "1.0",
        ki18n("Test program."),
        KAboutData::License_GPL,
        ki18n("(c) 2014 Jordan Melo"),
        ki18n("Enables the exploration and rendering of fractals."),
        "http://jmelo.net/",
        "*****@*****.**"
    );

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

    KCmdLineOptions options;
    options.add("+[file]", ki18n("Document to open"));
    KCmdLineArgs::addCmdLineOptions(options);

    KApplication app;

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

    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();

    return app.exec();
}
コード例 #4
0
ファイル: main.cpp プロジェクト: ruphy/orario
int main(int argc, char *argv[])
{
    KAboutData aboutData("orario", 0, ki18n("Orario"),
                         "0.1", ki18n("Description"), 
                         KAboutData::License_GPL,
                         ki18n("(c) 2008  Riccardo Iaconelli"), 
                         KLocalizedString(), "", "*****@*****.**");
    aboutData.addAuthor(ki18n("Riccardo Iaconelli"), KLocalizedString(), "*****@*****.**");

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

    KCmdLineOptions options;
    KCmdLineArgs::addCmdLineOptions(options);
    KCmdLineArgs::parsedArgs();
    KApplication app;
    
    KMainWindow *wi = new KMainWindow;
    QWidget *w = new QWidget;
    Ui::Form ui;
    ui.setupUi(w);
    wi->setCentralWidget(w);
    wi->show();

    return app.exec();
}
コード例 #5
0
ファイル: kcmdlineargs.cpp プロジェクト: fluxer/kdelibs
void
KCmdLineArgs::initIgnore(int _argc, char **_argv, const QByteArray &_appname )
{
   init(_argc, _argv,
        new KAboutData(_appname, 0, ki18n(_appname), "unknown", ki18n("KDE Application")));
   s->ignoreUnknown = true;
}
コード例 #6
0
ファイル: main.cpp プロジェクト: vilkov/phonon-vlc-mplayer
int main(int argc, char * argv[]) {
    Q_INIT_RESOURCE(multiplevideoplayer);

#ifdef KDE4_FOUND
    KAboutData aboutData("multiplevideoplayer", 0,
                         ki18n(""), "",
                         ki18n(""),
                         KAboutData::License_GPL,
                         ki18n(""));

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

    KApplication app;
#else
    QApplication app(argc, argv);
#endif	//KDE4_FOUND

    app.setApplicationName("VideoPlayer");
    app.setQuitOnLastWindowClosed(true);

    MainWindow window(NULL);
    window.show();

    return app.exec();
}
コード例 #7
0
ファイル: main.cpp プロジェクト: premstromer/raptor
int main(int argc, char *argv[])
{
    KAboutData aboutData("itemview-test", 0, ki18n("test for item view"),
                         "0.1", ki18n("test app"),
                         KAboutData::License_GPL,
                         ki18n("(c) 2008 Alessandro Diaferia"),
                         KLocalizedString(), "", "*****@*****.**");
    aboutData.addAuthor(ki18n("Alessandro Diaferia"), KLocalizedString(), "*****@*****.**");

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

    KCmdLineOptions options;
    KCmdLineArgs::addCmdLineOptions(options);
    KCmdLineArgs::parsedArgs();
    KApplication app;

    KDialog *window = new KDialog();
    RaptorItemsView *itemsView = new RaptorItemsView(window);
    Kickoff::ApplicationModel *model = new Kickoff::ApplicationModel();
    itemsView->setModel(model);
    RaptorItemDelegate *delegate = new RaptorItemDelegate();
    itemsView->setItemDelegate(delegate);

    window->setMainWidget(itemsView);

    window->show();

   return app.exec();
    
}
コード例 #8
0
ファイル: Installer.cpp プロジェクト: KDE/kde-workspace
int main(int argc, char **argv)
{
    KCmdLineArgs::init(argc, argv, &aboutData);

    KCmdLineOptions options;
    options.add("embed <winid>", ki18n("Makes the dialog transient for an X app specified by winid"));
    options.add("+[URL]", ki18n("URL to install"));
    KCmdLineArgs::addCmdLineOptions(options);

    QSet<KUrl>   urls;
    KCmdLineArgs *args(KCmdLineArgs::parsedArgs());

    for(int i=0; i < args->count(); i++)
        urls.insert(args->url(i));

    if(urls.count())
    {

        KApplication    app;
        QString         opt(args->getOption("embed"));
        KFI::CInstaller inst(createParent(opt.size() ? opt.toInt(0, 16) : 0));

        return inst.install(urls);
    }

    return -1;
}
コード例 #9
0
ファイル: main.cpp プロジェクト: Miestro/qCheckGMail
int main(int argc, char *argv[])
{
	KAboutData aboutData( 	"qCheckGMail",
				0,
				ki18n( "qCheckGMail" ),
				"1.0.0",
				ki18n( "a qt based gmail checker" ),
				KAboutData::License_GPL_V2,
				ki18n( "(c)2013,ink Francis\nemail:[email protected]" ),
				ki18n( "*****@*****.**" ),
				"(c)2013,ink Francis\nemail:[email protected]",
				"https://github.com/mhogomchungu/qCheckGMail/issues" );

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

	KCmdLineOptions options;
	options.add( "a",ki18n( "auto start application" ) ) ;
	KCmdLineArgs::addCmdLineOptions( options ) ;
	KUniqueApplication::addCmdLineOptions();

	if( KCmdLineArgs::allArguments().contains( "-a" ) ){
		if( configurationoptionsdialog::autoStartEnabled() ){
			return startApp() ;
		}else{
			return qCheckGMail::autoStartDisabled() ;
		}
	}else{
		return startApp() ;
	}
}
コード例 #10
0
int main(int argc, char **argv)
{
    KAboutData about("khotnewstuff", 0, ki18n("KHotNewStuff"), "0.4");
    about.setProgramIconName("get-hot-new-stuff");
    KCmdLineArgs *args;

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

    KCmdLineOptions op;
    op.add("+filename", ki18n("Name of .knsrc file to use"));
    op.add("+filename", ki18n("Name of file to upload"));
    KCmdLineArgs::addCmdLineOptions(op);
    args = KCmdLineArgs::parsedArgs();

    KApplication i;
    
    if (args->count() > 0) {
        KNS3::UploadDialog dialog(args->arg(0));
        if (args->count() > 1) {
            dialog.setUploadFile(KUrl(args->arg(1)));
        }
        dialog.exec();
    }
    else
    {
        args->usage();
        return -1;
    }
    return 0;
}
コード例 #11
0
ファイル: main.cpp プロジェクト: KDE/kross-interpreters
int main (int argc, char *argv[])
{
    // Used to store information about a program.
    KAboutData aboutData("krosshello",
        0,
        ki18n("Kross+Falcon Hello World"),
        "1.0",
        ki18n("Hello World application for Kross + Falcon"),
        KAboutData::License_GPL,
        ki18n("(c) 2008"),
        ki18n("This test shows a minimal usage of Falcon actions under the Kross hood."),
        "http://kross.dipe.org",
        "*****@*****.**");
 
    // Access to the command-line arguments.
    KCmdLineArgs::init( argc, argv, &aboutData );
    // Initialize the application.
    KApplication app;
 
    // Create and show the main window.
    MainWindow* window = new MainWindow();
    window->show();
 
    // Finally execute the application.
    return app.exec();
}
コード例 #12
0
ファイル: main.cpp プロジェクト: ruphy/plasma-theme-tester
int main(int argc, char *argv[])
{
    KAboutData aboutData("PTT", 0, ki18n("Plasma Theme Tester"),
                         "0.1", ki18n("Description"), 
                         KAboutData::License_GPL,
                         ki18n("(c) 2008  Riccardo Iaconelli"), 
                         KLocalizedString(), "", "*****@*****.**");
    aboutData.addAuthor(ki18n("Riccardo Iaconelli"), KLocalizedString(), "*****@*****.**");

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

    KCmdLineOptions options;
    KCmdLineArgs::addCmdLineOptions(options);
    KCmdLineArgs::parsedArgs();
    KApplication app;

    Ui::MainWindow ui;
    KMainWindow *mw = new KMainWindow;
    ui.setupUi(mw);

// set all the properties...
    ui.background->setType("background");

    mw->show();

    return app.exec();
}
コード例 #13
0
int main(int argc,char **argv)
{
  KLocale::setMainCatalog( "kdepimwizards" ); 

  KAboutData aboutData( "groupwisewizard", 0,
                        ki18n( "Novell GroupWise Configuration Wizard" ),
                        "0.1" );
  KCmdLineArgs::init( argc, argv, &aboutData );

  KCmdLineOptions options;
  options.add("verbose", ki18n("Verbose output"));
  KCmdLineArgs::addCmdLineOptions( options );

  KApplication app;

  KGlobal::locale()->insertCatalog( "libkdepim" );

  KCmdLineArgs *args = KCmdLineArgs::parsedArgs();

  bool verbose = false;
  if ( args->isSet( "verbose" ) ) verbose = true;
  args->clear();
  GroupwiseWizard wizard;

  return wizard.exec();
}
コード例 #14
0
ファイル: main.cpp プロジェクト: Axure/okular
int main(int argc, char **argv)
{
    KAboutData about("active-documentviewer", 0, ki18n("Reader"), version, ki18n(description),
                     KAboutData::License_GPL, ki18n("Copyright 2012 Marco Martin"), KLocalizedString(), 0, "*****@*****.**");
                     about.addAuthor( ki18n("Marco Martin"), KLocalizedString(), "*****@*****.**" );
    about.setProgramIconName("okular");

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

    KCmdLineOptions options;
    options.add("+[url]", ki18n( "URL of the file to open" ));

    KCmdLineArgs::addCmdLineOptions(options);
    KApplication app;

    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();

    KGlobal::locale()->insertCatalog("org.kde.okular");
    //kDebug() << "ARGS:" << args << args->count();

    KDeclarativeMainWindow *mainWindow = new KDeclarativeMainWindow();
    mainWindow->declarativeView()->setPackageName("org.kde.active.documentviewer");
    mainWindow->show();
    args->clear();
    return app.exec();
}
コード例 #15
0
ファイル: main.cpp プロジェクト: fluxer/kde-workspace
int main(int argc, char *argv[])
{
  // kdeinit waits for kcminit to finish, but during KDE startup
  // only important kcm's are started very early in the login process,
  // the rest is delayed, so fork and make parent return after the initial phase
  pipe( ready );
  if( fork() != 0 )
  {
      waitForReady();
      return 0;
  }
  close( ready[ 0 ] );

  startup = ( strcmp( argv[ 0 ], "kcminit_startup" ) == 0 ); // started from startkde?
  KAboutData aboutData( "kcminit", "kcminit", ki18n("KCMInit"),
                        "",
                        ki18n("KCMInit - runs startup initialization for Control Modules."));

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

  KCmdLineOptions options;
  options.add("list", ki18n("List modules that are run at startup"));
  options.add("+module", ki18n("Configuration module to run"));
  KCmdLineArgs::addCmdLineOptions( options ); // Add our own options.

  KApplication app;
  QDBusConnection::sessionBus().interface()->registerService( "org.kde.kcminit",
      QDBusConnectionInterface::DontQueueService );
  KLocale::setMainCatalog(0);
  KCMInit kcminit( KCmdLineArgs::parsedArgs());
  return 0;
}
コード例 #16
0
ファイル: KDEWallet.cpp プロジェクト: maciex/mozilla-kwallet
NS_IMETHODIMP KDEWallet::Init() {
    PR_LOG( gKDEWalletLog, PR_LOG_DEBUG, ( "KDEWallet::Init() Called") );

    if (this->GetAppID().Equals(FIREFOX_APP_ID)) {
        mozillaApp = Firefox;
    } else if (this->GetAppID().Equals(THUNDERBIRD_APP_ID)) {
        mozillaApp = Thunderbird;
    } else {
        mozillaApp = Unknown;
    }
    InitDefaultPreferenceValues();

    /* KWallet requries a functioning KApplication or it will segfault */
    KAboutData* aboutData = NULL;
    switch(mozillaApp) {
    case Firefox:
        aboutData = new KAboutData("Firefox", NULL, ki18n("Firefox KWallet Plugin"), "" );
        break;
    case Thunderbird:
        aboutData = new KAboutData("Thunderbird", NULL, ki18n("Thunderbird KWallet Plugin"), "" );
        break;
    default:
        aboutData = new KAboutData("Unknown Mozilla Application", NULL, ki18n("Unknown Mozilla Application KWallet Plugin"), "" );
        break;
    }

    KCmdLineArgs::init( aboutData );
    app = new KApplication(false);

    nsresult res = checkWallet();
    NS_ENSURE_SUCCESS(res, res);

    return NS_OK;
}
コード例 #17
0
ファイル: main.cpp プロジェクト: fredollinger/KTomGirl
int main( int argc, char *argv[] )
{
  QString version = QString::number( KTOMGIRL_VERSION );

  KAboutData aboutData( "KTomGirl",
                         0,
                         ki18n( "KTomGirl" ),
                         version.toLatin1(),
                         ki18n( "KDE Tomboy Note Taking Clone" ),
                         KAboutData::License_GPL,
                         ki18n( "(c) 1997-2013, The KTomGirl Developers" ) );

  knotesAuthors( aboutData );

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

  // Command line options

  KCmdLineArgs::addCmdLineOptions( knotesOptions() );

  // KUniqueApplication::addCmdLineOptions();

  // Create Application
  knotes::Application app;
  KGlobal::locale()->insertCatalog("libkdepim");
  app.newInstance();

  // remove_sm_from_client_leader();

  return app.exec();
}
コード例 #18
0
int main(int argc, char **argv)
{
  KAboutData about("KNetworkStatusTestClient", 0, ki18n("knetworkstatustestclient"), version, ki18n(description), KAboutData::License_GPL, ki18n("(C) 2007 Will Stephenson"), KLocalizedString(), 0, "*****@*****.**");
  about.addAuthor( ki18n("Will Stephenson"), KLocalizedString(), "*****@*****.**" );
  KCmdLineArgs::init(argc, argv, &about);

  KCmdLineOptions options;
  KCmdLineArgs::addCmdLineOptions(options);
  KApplication app;

  KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
  if (args->count() == 0)
  {
    TestClient *widget = new TestClient;
    widget->show();
  }
  else
  {
    int i = 0;
    for (; i < args->count(); i++)
    {
      TestClient *widget = new TestClient;
      widget->show();
    }
  }
  args->clear();

  return app.exec();
}
コード例 #19
0
int main(int argc, char *argv[])
{
    KCmdLineArgs::init(argc, argv, "testkhtml", 0, ki18n("Testkhtml"), "1.0",
            ki18n("a basic web browser using the KHTML library"));

    KCmdLineOptions options;
    options.add("+file", ki18n("url to open"));
    KCmdLineArgs::addCmdLineOptions(options);

    KApplication app;
    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
    if (args->count() == 0)
    {
        KCmdLineArgs::usage();
        ::exit( 1 );
    }

    TestKHTML *test = new TestKHTML;
    if (args->url(0).url().right(4).toLower() == ".xml")
    {
        KParts::OpenUrlArguments args(test->doc()->arguments());
        args.setMimeType("text/xml");
        test->doc()->setArguments(args);
    }

    test->openUrl(args->url(0));
    test->show();

    return app.exec();
}
コード例 #20
0
ファイル: knewstuff2_test.cpp プロジェクト: vasi/kdelibs
int main(int argc, char **argv)
{
    KCmdLineOptions options;
    options.add("testall", ki18n("Downloads all previews and payloads"));

    KCmdLineArgs::init(argc, argv, "knewstuff2_test", 0, ki18n("knewstuff2_test"), 0);
    KCmdLineArgs::addCmdLineOptions(options);
    KApplication app(false);

    // Take source directory into account
    kDebug() << "-- adding source directory " << KNSSRCDIR;
    kDebug() << "-- adding build directory " << KNSBUILDDIR;
    KGlobal::dirs()->addResourceDir("config", KNSSRCDIR);
    KGlobal::dirs()->addResourceDir("config", KNSBUILDDIR);

    KNewStuff2Test *test = new KNewStuff2Test();
    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
    if (args->isSet("testall")) {
        test->setTestAll(true);
        test->entryTest();
        test->providerTest();
    }
    test->engineTest();

    return app.exec();
}
コード例 #21
0
int kdemain( int argc, char **argv )
{
  KAboutData aboutData ( ABOUT_APP_NAME,
                         ABOUT_CATALOG_NAME,
                         ki18n(ABOUT_PROGRAM_NAME),
                         ABOUT_VERSION,
                         ki18n(ABOUT_DESCRIPTION),
                         ABOUT_LICENCE_TYPE,
                         ki18n(ABOUT_COPYRIGHT),
                         ki18n(ABOUT_INFORMATION),
                         ABOUT_WEBPAGE,
                         ABOUT_EMAIL );
  KComponentData componentData ( aboutData );

  QCoreApplication app( argc, argv );

  if (argc != 4)
  {
    fprintf(stderr, i18n("Usage: ").arg("kio_klipper protocol domain-socket1 domain-socket2\n").toUtf8() );
    exit(-1);
  }

  kDebug() << QString("started kio slave '%1' with PID %2").arg(argv[0]).arg(getpid());
  KIO_CLIPBOARD::KIOKlipperProtocol slave(argv[2], argv[3]);
  slave.dispatchLoop();

  kDebug() << "slave done";
  return ( 0 );
} // kdemain
コード例 #22
0
ファイル: krootimage.cpp プロジェクト: aarontc/kde-workspace
int
main(int argc, char *argv[])
{
    KCmdLineArgs::init(argc, argv, "krootimage", "kdmgreet",
                       ki18n("KRootImage"), QByteArray(),
                       ki18n("Fancy desktop background for kdm"));

    KCmdLineOptions options;
    options.add("+config", ki18n("Name of the configuration file"));
    KCmdLineArgs::addCmdLineOptions(options);

    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
    if (!args->count())
        args->usage();
    KComponentData inst(KCmdLineArgs::aboutData());
    MyApplication app(args->arg(0).toLocal8Bit(),
                      KCmdLineArgs::qtArgc(), KCmdLineArgs::qtArgv());
    args->clear();

    app.exec();
    app.flush();

    // Keep color resources after termination
    XSetCloseDownMode(QX11Info::display(), RetainTemporary);

    return 0;
}
コード例 #23
0
ファイル: main.cpp プロジェクト: KDE/simon
int main(int argc, char *argv[])
{
  KAboutData aboutData( "simon", 0,
    ki18n("Simon"), simon_version,
    ki18n("<html><head /><body>"
          "<h2>Development and Distribution</h2>"
          "<p>Developed in part by the non-profit organization"
          " <a href=\"http://simon-listens.org\">Simon listens e.V.</a>"
          " in cooperation with <a href=\"http://cyber-byte.at\">Cyber-Byte EDV Services</a>.</p>"
          "<h3>Special Thanks To</h3>"
          "<ul><li>Franz Stieger</li><li>Mathias Stieger</li><li>Phillip Theussl</li><li>Moacyr Prado</li><li>Michael Stieger</li><li>Ralf Herzog</li></ul>"
          "</body></html>"),
          KAboutData::License_GPL,
          ki18n("Copyright (c) 2008-2012 Peter Grasch, Phillip Goriup, Tschernegg Susanne, Bettina Sturmann, Martin Gigerl, Adam Nash, Frederik Gladhorn, Patrick von Reth, Alessadro Buggin, Mario Strametz, Vladislav Sitalo, Yash Shah") );

  KCmdLineOptions options;
  options.add("nosplash", ki18n("Disable Simon's splash screen"));
  KCmdLineArgs::addCmdLineOptions(options);

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

  SimonApplication app;
  app.setWindowIcon(KIcon("simon"));
  app.addLibraryPath(app.applicationDirPath()+"/plugins");

  SimonView *pv = new SimonView();

  Q_UNUSED(pv);
  int ret= app.exec();
//   pv is deleted automatically
  return ret;
}
コード例 #24
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();
}
コード例 #25
0
int main(int argc, char **argv)
{
    KAboutData about("kglobalsettingsclient", 0, ki18n("kglobalsettingsclient"), "version");
    KCmdLineArgs::init(argc, argv, &about);

    KCmdLineOptions options;
    options.add("p", ki18n("emit paletteChanged()"));
    options.add("f", ki18n("emit fontChanged()"));
    options.add("ps", ki18n("emit settingsChanged(SETTINGS_PATH)"));

    KCmdLineArgs::addCmdLineOptions( options );
    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();

    KComponentData componentData(&about); // for KConfig
    QApplication app( KCmdLineArgs::qtArgc(), KCmdLineArgs::qtArgv(), false );

    if (args->isSet("p")) {
        kDebug() << "emitChange(PaletteChanged)";
        KGlobalSettings::self()->emitChange(KGlobalSettings::PaletteChanged);
	return 0;
    } else if (args->isSet("f")) {
        kDebug() << "emitChange(FontChanged)";
        KGlobalSettings::self()->emitChange(KGlobalSettings::FontChanged);
        return 0;
    } else if (args->isSet("ps")) {
        kDebug() << "emitChange(SettingsChanged)";
        KGlobalSettings::self()->emitChange(KGlobalSettings::SettingsChanged, KGlobalSettings::SETTINGS_PATHS);
        return 0;
    }

    KCmdLineArgs::usage("No action specified");
    return 1; //notreached
}
コード例 #26
0
RenameImagesDialog::RenameImagesDialog(const KUrl::List& images,
                                       KIPI::Interface* interface,
                                       QWidget* parent)
    : KDialog(parent)
{
    setCaption(i18n("Rename Images"));
    setModal(true);
    setButtons(Help | User1 | Close);
    setButtonText(User1, i18n("&Start"));
    setDefaultButton(Close);
    // About data and help button.

    m_about = new KIPIPlugins::KPAboutData(ki18n("Batch-rename images"),
                                           QByteArray(),
                                           KAboutData::License_GPL,
                                           ki18n("A Kipi plugin to batch-rename images"),
                                           ki18n("(c) 2003-2007, Gilles Caulier"));

    m_about->addAuthor(ki18n("Gilles Caulier"), ki18n("Author and maintainer"),
                       "caulier dot gilles at gmail dot com");

    DialogUtils::setupHelpButton(this, m_about);
    // gui

    QWidget* box = new QWidget(this);
    setMainWidget(box);
    Q3VBoxLayout* lay = new Q3VBoxLayout(box);
    m_widget = new RenameImagesWidget(box, interface, images);
    lay->addWidget(m_widget);

    connect(this, SIGNAL(user1Clicked()),
            m_widget, SLOT(slotStart()));
    
    adjustSize();
}
コード例 #27
0
ファイル: kionetrctest.cpp プロジェクト: vasi/kdelibs
int main(int argc, char **argv)
{
    const char *version = "0.5";
    KLocalizedString description = ki18n("Unit test for .netrc and kionetrc parser.");
    KCmdLineOptions options;
    options.add("+command", ki18n("[url1,url2 ,...]"));

    KCmdLineArgs::init( argc, argv, "kionetrctest", 0, ki18n("KIO-netrc-test"), version, description );
    KCmdLineArgs::addCmdLineOptions( options );
    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
    int count = args->count();
    KApplication app;

    if ( !count )
        args->usage();
    else
    {
        KUrl u;
        for( int i=0 ; i < count; i++ )
        {
            u = args->arg(i);
            if ( !u.isValid() )
            {
                kDebug() << u.url() << " is invalid! Ignoring...";
                continue;
            }
            output( u );
        }
    }
    args->clear();
    return 0;
}
コード例 #28
0
ファイル: crossfade.cpp プロジェクト: KDE/kdeexamples
int main(int argc, char ** argv)
{
    KCmdLineOptions options;
    options.add("+URL1", ki18n("The first URL to play"));
    options.add("+URL2", ki18n("The second URL to play"));

    KAboutData about("crossfade", 0, ki18n("Phonon Crossfade Example"),
            "1.0", KLocalizedString(),
            KAboutData::License_LGPL);
    about.addAuthor(ki18n("Matthias Kretz"), KLocalizedString(), "*****@*****.**");
    KCmdLineArgs::init(argc, argv, &about);
    KCmdLineArgs::addCmdLineOptions(options);
    KApplication app;
    KUrl url1;
    KUrl url2;
    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
    if (args->count() == 2)
    {
        url1 = args->url(0);
        url2 = args->url(1);
        if (url1.isValid() && url2.isValid())
        {
            Crossfader xfader(url1, url2);
            return app.exec();
        }
    }
    return 1;
}
コード例 #29
0
int main( int argc, char **argv )
{
	KCmdLineArgs::init( argc, argv, "klistviewtest", 0, ki18n("K3ListViewTest"), "1.0", ki18n("klistview test app"));
	KApplication app;
	KDialog dialog;
	K3ListView *view = new K3ListView();
  dialog.setMainWidget(view);
	view->setSelectionModeExt( K3ListView::FileManager );
	view->setDragEnabled( true );
	view->setItemsMovable( false );
	view->setAcceptDrops( true );
	view->addColumn("Column 1");
	view->addColumn("Column 2");
	view->addColumn("Column 3");

	new K3ListViewItem( view, "Item 1");
	new K3ListViewItem( view, "Item 1");
	new K3ListViewItem( view, "Item 1");
	new K3ListViewItem( view, "Item 1");
	new K3ListViewItem( view, "Item 1");
	new K3ListViewItem( view, "Item 1");
	new K3ListViewItem( view, "Item 1");
	new K3ListViewItem( view, "Item 1");
	new K3ListViewItem( view, "Item 1");
	new K3ListViewItem( view, "Item 2", "Some more", "Hi Mom :)" );

	view->restoreLayout( KGlobal::config().data(), "ListView" );

	new K3ListViewItem( view, "Item 3" );

	dialog.exec();
	view->saveLayout( KGlobal::config().data(), "ListView" );

	return 0;
}
コード例 #30
0
ファイル: main.cpp プロジェクト: choueric/kscope-4
int main(int argc, char **argv)
{
    KAboutData aboutData( "husky_test", "husky_test",
        ki18n("husky_test"), "0.1",
        ki18n("test."),
        KAboutData::License_GPL,
        ki18n("Copyright (c) 2013") );

    KCmdLineArgs::init( argc, argv, &aboutData );
    KCmdLineOptions options;
    options.add("+[file]", ki18n("demo argument"));
    KCmdLineArgs::addCmdLineOptions(options);
 
    // parse command line arguments
    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
    if(args->count()) {
        std::cout << "have args " << args->count() << std::endl;
    }

    KApplication app;

    Mainwin *p = new Mainwin;
    p->show();

    return app.exec();
}