TDE core libraries
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

kpropsdlgtest.cpp 1.1KB

1234567891011121314151617181920212223242526272829303132333435
  1. #include <tdeapplication.h>
  2. #include <tdelocale.h>
  3. #include <tdeaboutdata.h>
  4. #include <kpropertiesdialog.h>
  5. #include <tdecmdlineargs.h>
  6. static TDECmdLineOptions options[] =
  7. {
  8. { "+url", "the path or url to the file/dir for which to show properties", 0 },
  9. TDECmdLineLastOption
  10. };
  11. int main ( int argc, char** argv )
  12. {
  13. TDEAboutData aboutData("kpropertiesdialogtest", "TDEIO Properties Dialog Test", "1.0");
  14. TDECmdLineArgs::init(argc, argv, &aboutData);
  15. TDECmdLineArgs::addCmdLineOptions( options );
  16. TDEApplication app;
  17. TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
  18. if ( args->count() < 1 )
  19. TDECmdLineArgs::usage();
  20. KURL u = args->url( 0 );
  21. // This is the test for the KPropertiesDialog constructor that is now
  22. // documented to NOT work. Passing only a URL means a TDEIO::stat will happen,
  23. // and asking for the dialog to be modal too creates problems.
  24. // (A non-modal, URL-only dialog is the one kicker uses for app buttons, no problem there)
  25. KPropertiesDialog* dlg = new KPropertiesDialog( u, 0, 0, true /*modal*/, false /*we do exec ourselves*/ );
  26. dlg->exec();
  27. return 0;
  28. }