KDpkg – frontend for dpkg
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.

88 lines
2.5KB

  1. /*
  2. * main.cpp
  3. *
  4. * Copyright (c) 2007 Fabian Wuertz
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  18. */
  19. #ifdef HAVE_CONFIG_H
  20. #include "config.h"
  21. #else
  22. #define PREFIX "/usr"
  23. #endif
  24. #include "install.h"
  25. #include <tdeapplication.h>
  26. #include <tdeaboutdata.h>
  27. #include <tdecmdlineargs.h>
  28. #include <tdelocale.h>
  29. static TDECmdLineOptions options[] =
  30. {
  31. { "+[URL]", I18N_NOOP("Location to open"), 0 },
  32. TDECmdLineLastOption
  33. };
  34. int main(int argc, char **argv)
  35. {
  36. // specify data for About dialog
  37. TDEAboutData* about = new TDEAboutData("kdpkg-install", I18N_NOOP("kdpkg-install"), "");
  38. about->setProgramLogo( TQImage( PREFIX "/share/icons/hicolor/32x32/apps/kdpkg.png") );
  39. about->setShortDescription( I18N_NOOP("Frontend for dpkg.") );
  40. about->setLicense(TDEAboutData::License_GPL_V2);
  41. about->setHomepage("http://trinity.pearsoncomputing.net");
  42. about->setBugAddress("http://bugs.pearsoncomputing.net");
  43. about->setCopyrightStatement("(c) 2010 Timothy Pearson\n(c) 2007 Fabian Würtz");
  44. about->addAuthor("Timothy Pearson (Trinity Project)", I18N_NOOP("Developer"), "kb9vqf@pearsoncomputing.net", "http://trinity.pearsoncomputing.net");
  45. about->addAuthor("Fabian Würtz (xadras)", I18N_NOOP("Developer"), "xadras@sidux.com", "http://linux.wuertz.org/");
  46. TDECmdLineArgs::init(argc, argv, about);
  47. TDECmdLineArgs::addCmdLineOptions( options );
  48. TDEApplication app;
  49. install *mainWin = 0;
  50. if (!app.isRestored())
  51. {
  52. // no session.. just start up normally
  53. TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
  54. TQString url;
  55. for(int i = 0; i < args->count(); i++) // Counting start at 0!
  56. url = TQString::fromLocal8Bit(args->arg(i));
  57. //printf(url);
  58. mainWin = new install( url );
  59. app.setMainWidget( mainWin );
  60. //mainWin->getFile(url);
  61. mainWin->show();
  62. args->clear();
  63. }
  64. // mainWin has WDestructiveClose flag by default, so it will delete itself.
  65. return app.exec();
  66. }