PageRenderTime 30ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/src/ui/dialog/updatecheckerdialog.cpp

https://github.com/metaxy/openBibleViewer
C++ | 61 lines | 43 code | 5 blank | 13 comment | 0 complexity | 3bdc0dff476ed78728c7cf015be9f254 MD5 | raw file
Possible License(s): GPL-3.0
  1. /***************************************************************************
  2. openBibleViewer - Bible Study Tool
  3. Copyright (C) 2009-2012 Paul Walger <metaxy@walger.name>
  4. This program is free software; you can redistribute it and/or modify it
  5. under the terms of the GNU General Public License as published by the Free
  6. Software Foundation; either version 3 of the License, or (at your option)
  7. any later version.
  8. This program is distributed in the hope that it will be useful, but WITHOUT
  9. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  10. FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License along with
  12. this program; if not, see <http://www.gnu.org/licenses/>.
  13. *****************************************************************************/
  14. #include "updatecheckerdialog.h"
  15. #include "ui_updatecheckerdialog.h"
  16. #include <QDesktopServices>
  17. #include <QUrl>
  18. UpdateCheckerDialog::UpdateCheckerDialog(QWidget *parent) :
  19. QDialog(parent),
  20. ui(new Ui::UpdateCheckerDialog)
  21. {
  22. ui->setupUi(this);
  23. connect(ui->pushButton_later, SIGNAL(clicked()), this, SLOT(later()));
  24. connect(ui->pushButton_skip, SIGNAL(clicked()), this, SLOT(skip()));
  25. connect(ui->pushButton_download, SIGNAL(clicked()), this, SLOT(download()));
  26. }
  27. UpdateCheckerDialog::~UpdateCheckerDialog()
  28. {
  29. delete ui;
  30. }
  31. void UpdateCheckerDialog::setText(const QString &text)
  32. {
  33. ui->label->setText(text);
  34. }
  35. void UpdateCheckerDialog::setUrl(const QString &url)
  36. {
  37. m_url = url;
  38. }
  39. void UpdateCheckerDialog::setVersion(const QString &version)
  40. {
  41. m_version = version;
  42. }
  43. void UpdateCheckerDialog::skip()
  44. {
  45. m_settings->session.file()->setValue(m_settings->session.id() + "/" + "skipVersion", m_version);
  46. close();
  47. }
  48. void UpdateCheckerDialog::later()
  49. {
  50. close();
  51. }
  52. void UpdateCheckerDialog::download()
  53. {
  54. QDesktopServices::openUrl(QUrl(m_url));
  55. close();
  56. }