PageRenderTime 42ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/Velocity/about.cpp

https://bitbucket.org/SteffenAL/velocity
C++ | 58 lines | 45 code | 12 blank | 1 comment | 1 complexity | 1f8b877f7146607cb3ff066b0d21e6ba MD5 | raw file
  1. #include "about.h"
  2. #include "ui_about.h"
  3. About::About(QWidget *parent) :
  4. QDialog(parent),
  5. ui(new Ui::About)
  6. {
  7. ui->setupUi(this);
  8. setFixedSize(sizeHint());
  9. setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
  10. QtHelpers::GenAdjustWidgetAppearanceToOS(this);
  11. #ifndef __linux
  12. if (!QFile::exists(QtHelpers::ExecutingDirectory() + "Developers.mp3"))
  13. return;
  14. developers = new Phonon::MediaObject(this);
  15. audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this);
  16. connect(developers, SIGNAL(finished()), this, SLOT(onSongFinished()));
  17. Phonon::createPath(developers, audioOutput);
  18. developers->setCurrentSource(Phonon::MediaSource(QtHelpers::ExecutingDirectory() + "Developers.mp3"));
  19. developers->play();
  20. #endif
  21. }
  22. About::~About()
  23. {
  24. delete ui;
  25. }
  26. void About::onSongFinished()
  27. {
  28. #ifndef __linux
  29. // for (;;) let's listen to it one more time;
  30. developers->clear();
  31. developers->setCurrentSource(Phonon::MediaSource(QtHelpers::ExecutingDirectory() + "Developers.mp3"));
  32. developers->play();
  33. #endif
  34. }
  35. void About::on_label_3_linkActivated(const QString &link)
  36. {
  37. QDesktopServices::openUrl(QUrl(link));
  38. }
  39. void About::on_pushButton_2_clicked()
  40. {
  41. QDesktopServices::openUrl(QUrl("https://github.com/hetelek/Velocity"));
  42. }
  43. void About::on_pushButton_clicked()
  44. {
  45. QDesktopServices::openUrl(QUrl("http://free60.org/Main_Page"));
  46. }