PageRenderTime 43ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/kst-2.0.3/src/libkstapp/aboutdialog.cpp

#
C++ | 89 lines | 60 code | 16 blank | 13 comment | 1 complexity | 777e71835c8da7ddae87fcb0d704a596 MD5 | raw file
Possible License(s): GPL-2.0, CC-BY-SA-3.0, LGPL-2.0
  1. /***************************************************************************
  2. * *
  3. * copyright : (C) 2009 The University of Toronto *
  4. * netterfield@astro.utoronto.ca *
  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 as published by *
  8. * the Free Software Foundation; either version 2 of the License, or *
  9. * (at your option) any later version. *
  10. * *
  11. ***************************************************************************/
  12. #include "config.h"
  13. #ifdef KST_HAVE_SVN_REVISION_H
  14. #include "svnrevision.h"
  15. #include "authors.h"
  16. #endif
  17. #include "aboutdialog.h"
  18. #include <QDesktopServices>
  19. #include <QDebug>
  20. #include <QTextEdit>
  21. #include <QStringList>
  22. namespace Kst {
  23. AboutDialog::AboutDialog(QWidget *parent)
  24. : QDialog(parent) {
  25. setupUi(this);
  26. #ifdef KST_HAVE_SVN_REVISION_H
  27. QStringList utf8Authors = QString::fromUtf8(kst_authors).trimmed().split(";");
  28. QStringList authors;
  29. foreach(const QString& a, utf8Authors) {
  30. if (!a.startsWith("#")) {
  31. authors << a;
  32. }
  33. }
  34. #else
  35. // qmake support
  36. QStringList authors = QStringList()
  37. << "Barth Netterfield"
  38. << "Matthew Truch"
  39. << "Nicolas Brisset"
  40. << "Staikos Computing Services Inc."
  41. << "Rick Chern"
  42. << "Sumus Technology Limited"
  43. << "Ted Kisner"
  44. << "The University of British Columbia"
  45. << "The University of Toronto"
  46. << "Andrew Walker"
  47. << "Peter Kümmel"
  48. << "Zongyi Zang";
  49. #endif
  50. authors.sort();
  51. authors.replaceInStrings("<", "&lt;");
  52. authors.replaceInStrings(">", "&gt;");
  53. authors.replaceInStrings(QRegExp("^(.*)"), "<li>\\1</li>");
  54. QStringList msg = QStringList()
  55. << tr("<qt><h2>Kst "KSTVERSION" - A data viewing program.</h2>")
  56. << tr("Revision "SVN_REVISION"<br><hr>")
  57. << tr("Copyright &copy; 2000-2011 Barth Netterfield<br><hr>")
  58. << tr("Homepage: <a href=\"http://kst-plot.kde.org/\">http://kst-plot.kde.org/</a><br>")
  59. << tr("Please report bugs with the 'Bug Report Wizard' of the 'Help' menu.<br>")
  60. << tr("<br>Authors and contributors (sorted alphabetically):")
  61. << QString("<ul>")
  62. << authors
  63. << QString("</ul>");
  64. text->setText(msg.join("\n"));
  65. connect(text, SIGNAL(anchorClicked(const QUrl &)), this, SLOT(launchURL(const QUrl&)));
  66. }
  67. AboutDialog::~AboutDialog() {
  68. }
  69. void AboutDialog::launchURL(const QUrl &link) {
  70. QDesktopServices::openUrl ( link );
  71. }
  72. }
  73. // vim: ts=2 sw=2 et